I was trying to use numpy.asarray(tensor) to convert a tensor into an ndarray. Then, I was planning to use PIL to convert that ndarray into a downloadable image. However, since I was running this code on a TPU, it got held up the numpy conversion and could not proceed to the PIL step. Is there any way to convert from a tensor to an image directly, without converting to an ndarray?
