torchvision.transforms. ToPILImage ( mode=None )[SOURCE] 96
Convert a tensor or an ndarray to PIL Image.
Converts a torch.*Tensor of shape C x H x W or a numpy ndarray of shape H x W x C to a PIL Image while preserving the value range.
Note: The shape of numpy ndarray should be HxWxC and the range of value in numpy.ndarray (H x W x C) should be [0, 255]. Your code meets such requirement?