title: Unable to Normalize Tensor in PyTorch
body: <p>I am trying to normalize the tensor outputted by my network but am getting an error in doing so. The code is as follows:</p>
  <pre class="lang-py prettyprint-override"><code>device = torch.device(&quot;cuda:0&quot; if torch.cuda.is_available() else &quot;cpu&quot;)
  model_load_path = r'path\to\saved\model\file'
  model.load_state_dict(torch.load(model_load_path))
  model.eval()
  output = model(input).to(device).view(-1, 1, 150, 150)
  inv_normalize = transforms.Compose(
      [
          transforms.Normalize(mean=[-0.5/0.5], std=[1/0.5])
      ]
  )
  print(output.size())  # The size printed is torch.Size([1, 1, 150, 150])
  output = inv_normalize(output)
  </code></pre>
  <p>I am getting an error in the following line:</p>
  <pre class="lang-py prettyprint-override"><code>output = inv_normalize(output)
  </code></pre>
  <p>The error reads:</p>
  <pre class="lang-py prettyprint-override"><code>TypeError: tensor is not a torch image.
  </code></pre>
  <p>My output is a single image, with a single channel, and height and width = 150</p>
  <p>Any help will be appreciated! Thanks!</p>