How to convert a matrix to heatmap image in torch

suppose a matrix like:

>>> a
tensor([[0.1000, 0.2000, 0.3000],
        [0.4000, 0.5000, 0.6000],
        [0.7000, 0.8000, 0.9000]])

I would like to visualize it as a heatmap image. I tried:

img = PIL.Image.fromarray(a.numpy())

However this image is too small in dimensions (3x3). I would like to scale or expand it so that I can view it better. What is the solution?

I found this answer: