title: Conv2d not accepting tensor as input, saying its not tensor
body: <p>I want to pass a tensor through a convolutional 2 layer. I am not able to execute it as I am getting a type error even though I have converted my numpy array to a tensor. </p>
  
  <p>I tried using tf.convert_to_tensor() to solve this problem. Didn't work</p>
  
  <pre class="lang-py prettyprint-override"><code>import numpy as np
  import tensorflow as tf
  
  class Generator():
  
    def __init__(self):
  
      self.conv1 = nn.Conv2d(1, 28, kernel_size=3, stride=1, padding=1)
      self.pool1 = nn.MaxPool2d(kernel_size=3, stride=0, padding=1)
  
      self.fc1 = nn.Linear(100, 10)
      self.fc2 = nn.Linear(10, 5)
  
    def forward_pass(self, x):                                                                       #Why do we pass the object itself in every method?
  
      x = self.conv1(x)
      print(x)
      x = self.pool1(x)
      print(x)
  
      x = self.fc1(x)
      print(x)
      x = self.fc2(x)
      print(x)
  
      return x
  
  arr = tf.convert_to_tensor(np.random.random((3,28,28)))
  
  gen = Generator()
  gen.forward_pass(arr)
  
  
  </code></pre>
  
  <p>Error message - </p>
  
  <pre class="lang-py prettyprint-override"><code>TypeError                                 Traceback (most recent call last)
  
  &lt;ipython-input-31-9fa8e764dcdb&gt; in &lt;module&gt;()
        1 gen = Generator()
  ----&gt; 2 gen.forward_pass(arr)
  
  2 frames
  
  /usr/local/lib/python3.6/dist-packages/torch/nn/modules/conv.py in forward(self, input)
      336                             _pair(0), self.dilation, self.groups)
      337         return F.conv2d(input, self.weight, self.bias, self.stride,
  --&gt; 338                         self.padding, self.dilation, self.groups)
      339 
      340 
  
  TypeError: conv2d(): argument 'input' (position 1) must be Tensor, not Tensor
  </code></pre>