This is the complete error message. When I call the function I get error.
RuntimeError                              Traceback (most recent call last)
<ipython-input-13-1ad2836344b5> in <module>()
----> 1 vis_model(net)

<ipython-input-12-d875cfa1fa86> in vis_model(net)
     18     net.eval()
     19     with torch.no_grad():
---> 20         outp=net(w)
     21         pred=torch.max(outp,1)
     22 

C:\ProgramData\Anaconda3\lib\site-packages\torch\nn\modules\module.py in __call__(self, *input, **kwargs)
    487             result = self._slow_forward(*input, **kwargs)
    488         else:
--> 489             result = self.forward(*input, **kwargs)
    490         for hook in self._forward_hooks.values():
    491             hook_result = hook(self, input, result)

<ipython-input-4-ce890d3bdcf7> in forward(self, x)
     13     def forward(self, x):
     14         print(x.shape)
---> 15         out = self.cnn1(x)
     16         print(out.shape)
     17         out = self.relu1(out)

C:\ProgramData\Anaconda3\lib\site-packages\torch\nn\modules\module.py in __call__(self, *input, **kwargs)
    487             result = self._slow_forward(*input, **kwargs)
    488         else:
--> 489             result = self.forward(*input, **kwargs)
    490         for hook in self._forward_hooks.values():
    491             hook_result = hook(self, input, result)

C:\ProgramData\Anaconda3\lib\site-packages\torch\nn\modules\conv.py in forward(self, input)
    318     def forward(self, input):
    319         return F.conv2d(input, self.weight, self.bias, self.stride,
--> 320                         self.padding, self.dilation, self.groups)
    321 
    322 

RuntimeError: Expected object of scalar type Double but got scalar type Float for argument #2 'weight'