title: Unflatten a tensor back to an image
body: <p>I am working on GANs and I want to visualize the image formed.</p>
  <p>For this, I was trying</p>
  <pre><code>def show_images(image_tensor, num_images=9, size=(1, 28, 28)):
      image_unflat = image_tensor.detach().cpu.view(-1, *size)
      image_grid = make_grid(image_unflat[:num_images], nrow=3)
      plt.imshow(image_grid.permute(1, 2, 0).squeeze())
      plt.show()
  </code></pre>
  <p>but when I am trying to <code>show_image(some_tensor)</code>, I am getting an error as</p>
  <pre><code>image_unflat = image_tensor.detach().cpu.view(-1, *size)
  AttributeError: 'builtin_function_or_method' object has no attribute 'view'
  </code></pre>
  <p>Here, the size of some_tensor is N x 784.</p>