title: While converting a PIL image into a tensor why the pixels are changing?
body: <pre class="lang-py prettyprint-override"><code>transform = transforms.Compose([transforms.ToPILImage(), transforms.ToTensor()])
  </code></pre>
  <p><strong>Before applying the transformation</strong></p>
  <blockquote>
  <p><a href="https://i.stack.imgur.com/3HWa1.png" rel="noreferrer"><img src="https://i.stack.imgur.com/3HWa1.png" alt="Before applying the transformation" /></a></p>
  </blockquote>
  <p><strong>After applying the transformation</strong></p>
  <blockquote>
  <p><a href="https://i.stack.imgur.com/Vz9eT.png" rel="noreferrer"><img src="https://i.stack.imgur.com/Vz9eT.png" alt="After applying the transformation" /></a></p>
  </blockquote>
  <p>Q.1 Why the pixel values are changed?<br />
  Q.2 How to correct this?</p>