What I did: transfer the tensor to numpy array, reshape(if needed), and use plt.imshow():
import matplotlib.pyplot as plt
img_np_arr = img_tensor.numpy()   # transfer the pytorch tensor(img_tensor) to numpy array
img_np_arr.shape    # check shape before reshape if needed
img_np_arr_reshaped = img_np_arr.reshape(img_w, img_h)  # reshape to 2-dims image
plt.imshow(img_np_arr_reshaped, cmap='gray')   # when display the grayscale image