For some square images, I'd like to use torch.nn.Conv2d with the kernel as a vertical block. As in, the kernel size is defined as max value of the first dimension by 1. Since the first dimension has no more room, I'd like to have 0 stride along that first dimension. I tried using the following definition:
self.conv1 = torch.nn.Conv2d(3, 32, (max_dim_0, 1), stride=(0, 1), padding=0, dilation=1, groups=1, bias=True, padding_mode='zeros')
However, this causes my training loop throws a
RuntimeError: non-positive stride is not supported exception. Is there a way to define the kernel as a vertical block?