Hi everyone, I have an error message when I try to run a convolutional layer, the convolution layer is the following:
self.l_conv = nn.Conv2d(in_channels=self.arch['out_channels'][-1],out_channels=channels,kernel_size=3,padding=1)

Part of the error message is the following:
---------------------------------------------------------------------------
RuntimeError                              Traceback (most recent call last)
<ipython-input-23-b5acd2999739> in <module>()
     34         fake_label = torch.randint(0,num_classes,(n_batch,))
     35         fake_label = Variable(fake_label.cuda())
---> 36         G_out = netG(in_noise,fake_label)
     37 
     38         D_out_fake = netD(G_out,fake_label).squeeze()

<ipython-input-12-09ab6878f79c> in forward(self, z, y)
     65         out = self.bn(h)
     66         out = self.act(h)
---> 67         out = self.l_conv(h)
     68         out = torch.tanh(out)
     69 

/usr/local/lib/python3.6/dist-packages/torch/nn/modules/module.py in __call__(self, *input, **kwargs)
    530             result = self._slow_forward(*input, **kwargs)
    531         else:
--> 532             result = self.forward(*input, **kwargs)
    533         for hook in self._forward_hooks.values():
    534             hook_result = hook(self, input, result)

/usr/local/lib/python3.6/dist-packages/torch/nn/modules/conv.py in forward(self, input)
    343 
    344     def forward(self, input):
--> 345         return self.conv2d_forward(input, self.weight)
    346 
    347 class Conv3d(_ConvNd):

/usr/local/lib/python3.6/dist-packages/torch/nn/modules/conv.py in conv2d_forward(self, input, weight)
    340                             _pair(0), self.dilation, self.groups)
    341         return F.conv2d(input, weight, self.bias, self.stride,
--> 342                         self.padding, self.dilation, self.groups)
    343 
    344     def forward(self, input):

RuntimeError: cuDNN error: CUDNN_STATUS_NOT_SUPPORTED. This error may appear if you passed in a non-contiguous input.

This line works perfectly when I run it outside my training loop, so I am a bit confused about what is wrong. Thanks in advance.