title: Un-normalizing PyTorch data
body: <p>Below code : </p>
  
  <pre><code>ux = torch.tensor(np.array([[255,1,255],[255,1,255]])).float()
  
  print(ux)
  
  ux = F.normalize(ux, p=2, dim=1)
  
  print(ux)
  </code></pre>
  
  <p>prints : </p>
  
  <pre><code>tensor([[ 255.,    1.,  255.],
          [ 255.,    1.,  255.]])
  tensor([[ 0.7071,  0.0028,  0.7071],
          [ 0.7071,  0.0028,  0.7071]])
  </code></pre>
  
  <p>How can I un-normalize the <code>ux</code> in order to return to values </p>
  
  <pre><code>tensor([[ 255.,    1.,  255.],
          [ 255.,    1.,  255.]])
  </code></pre>
  
  <p>from</p>
  
  <pre><code>tensor([[ 0.7071,  0.0028,  0.7071],
          [ 0.7071,  0.0028,  0.7071]])
  </code></pre>
  
  <p>There are various resources that detail this process such as <a href="https://discuss.pytorch.org/t/simple-way-to-inverse-normalize-a-batch-of-input-variable/12385/3" rel="nofollow noreferrer">https://discuss.pytorch.org/t/simple-way-to-inverse-normalize-a-batch-of-input-variable/12385/3</a> but do not detail unnormalizing result of <code>F.normalize</code></p>