title: Convert image to proper dimension PyTorch
body: <p>I have an input image, as numpy array of shape [H, W, C] where H - height, W - width and C - channels.<br>
  I want to convert it into [B, C, H, W] where B - batch size, which should be equal to 1 every time, and changing the place for C.<br></p>
  
  <pre><code>_image = np.array(_image)
  h, w, c = _image.shape
  image = torch.from_numpy(_image).unsqueeze_(0).view(1, c, h, w)
  </code></pre>
  
  <p>So, will this preserve the image properly i.e without displacing the original image pixel values?</p>