Assuming you are using sklearn for extracting patches, you can use reconstruct_from_patches_2d 1 to reconstruct your image.
P.S. on the first edition of your response, you used torch.exp mistakenly instead of torch.nn.softmax() for computing softmax.