Saving final tensor output as tif images

Hi, I made a CNN model for edge detection task. The model did good and I can see the results through the feature maps (I’m not using the fc part of the model). I’m using the model to accept an input size as (1, 3, 224, 224) but the output tensor is (1, 4, 13, 13).
I want to save tensor output as (224, 224, 3) and to sum feature maps of each Conv layer as one image. If anyone could help it would appreciated.