def convNxN(in_p,out_p,N):
return nn.Conv2d(in_p,ou_p,kernel_size=(N,N),stride=(1,1),padding=(1,1),bias=False)
class Modelname(nn.Module):
def init(self):
self.Conv1 = convNxN(3,64,3)
#other Conv2d calls of the same way.
def forward(self,x):
out=self.Conv1(x)
# When I print it here, it already starts giving nans
By the way, I am using CIFAR-10 as dataset.