title: Pytorch: Trying to apply the transform to a numpy array... fails with an error
body: <p>Any help will be much appreciated. The code in transforms.py says that the transformation should/would apply to PIL images as well as ndarrays.
  Given the transforms:</p>
  
  <pre><code>data_transforms = {
      'train': transforms.Compose([
          transforms.Scale(256),
          transforms.Pad(4,0),
          transforms.ToTensor(),
          transforms.Normalize([0.485, 0.456, 0.406], [0.229, 0.224, 0.225])
      ]),
      'val': transforms.Compose([
          transforms.Scale(256),
          transforms.Pad(4,0),
          transforms.ToTensor(),
          transforms.Normalize([0.485, 0.456, 0.406], [0.229, 0.224, 0.225])
      ]),
  }
  </code></pre>
  
  <p>I wish to apply the transform on ndarrays that I obtained from some other code. Let's say it is x_data, whose shape is (1000,120,160,3) where the dimensions are (total rows, width, height, channels)</p>
  
  <p>doing the following fails (All I'm trying to do is apply a transformation) :</p>
  
  <pre><code>foo = data_transforms['train']
  bar = foo(x_data[0])
  </code></pre>
  
  <p>with the following message:</p>
  
  <pre><code>---------------------------------------------------------------------------
  TypeError                                 Traceback (most recent call last)
  &lt;ipython-input-93-a703e3b9c76d&gt; in &lt;module&gt;()
  ----&gt; 1 foo(x_data[1])
  
  ~/anaconda3/envs/pytorch/lib/python3.5/site-packages/torchvision-0.1.9-py3.5.egg/torchvision/transforms.py in __call__(self, img)
       32     def __call__(self, img):
       33         for t in self.transforms:
  ---&gt; 34             img = t(img)
       35         return img
       36 
  
  ~/anaconda3/envs/pytorch/lib/python3.5/site-packages/torchvision-0.1.9-py3.5.egg/torchvision/transforms.py in __call__(self, img)
      185         """
      186         if isinstance(self.size, int):
  --&gt; 187             w, h = img.size
      188             if (w &lt;= h and w == self.size) or (h &lt;= w and h == self.size):
      189                 return img
  
  TypeError: 'int' object is not iterable
  </code></pre>