title: Pytorch 'Tensor' object is not callable
body: <p>I am trying to apply sobel filter to my network. I am getting this error : "<em>'Tensor' object is not callable</em>" 
  Here is my code:</p>
  
  <pre><code>class SobelFilter(nn.Module):
      def __init__(self):
          super(SobelFilter, self).__init__()
  
          kernel1=torch.Tensor([[1, 0, -1],[2,0,-2],[1,0,-1]])
          kernela=kernel1.expand((1,1,3,3))
  
          kernel2=torch.Tensor([[1, 2, 1],[0,0,0],[-1,-2,-1]])
          kernelb=kernel2.expand((1,1,3,3))
  
          inputs = torch.randn(1,1,64,128)
  
          self.conv1 = F.conv2d(inputs,kernela,stride=1,padding=1)
          self.conv2 = F.conv2d(inputs,kernelb,stride=1,padding=1)
  
      def forward(self, x ):
  
          print(x.shape)
          G_x = self.conv1(x)    %GIVES ERROR AT THIS LINE
          G_y = self.conv2(x)
          out = torch.sqrt(torch.pow(G_x,2)+ torch.pow(G_y,2))
  
          return out
  </code></pre>
  
  <pre><code>class EXP(nn.Module):
      def __init__(self, maxdisp):
          super(EXP, self).__init__()
          self.device = torch.device("cuda:0" if torch.cuda.is_available() else "cpu")
          self.SobelFilter = SobelFilter()
  
      def forward(self, im):
          % just think "im" to be [1,32,64,128]
  
          for i in range(im.shape[1]):
              out1= im[:,i,:,:].unsqueeze(1)
              im[:,i,:,:] = self.SobelFilter(out1)
  
  </code></pre>
  
  <p>what can cause the problem?
  Thank you!</p>