I don’t know why cuDNN gives this error. As far as I know .transpose works by changing the strides of the view mechanism, not by moving the data, so if the data was contiguous before the transpose, then it still is afterwards. I suppose cuDNN could be a little picky about non-conventional view strides.
Replacing the 2nd call to .conv2d with the following might work… though I think it will end up making a copy the weight tensor on every forward pass.
x = nn.functional.conv2d(x, self.conv_weight.transpose(2,3).contiguous(), ...)