Once my autoencoder is trained, its output is a tensor of shape [bs, h, w], where h and w are the height and width of the input image
i want to visualize an output image, so i choose the 1st one
img = output[1, :, :]
now the shape og img is [h, w]
and its dtype is torch.float32
Now i have 2 options here,


i can convert the output pixel values to uint8 [0 to 255]
cv2.imshow(  (img.numpy()*255).astype(np.uin8)  )


or i can simply use the imshow of matplotlib which does not convert the pixel values to 0 to 255 uint8
plt.imshow(img, cmap = ‘gray’)


Which one is more appropriate and shows the image without losing much inforamtion ?
Thanks in advance