Thank you for your reply!
I know entropy is still in GPU, what I want to do is to eliminate the intermediate tensor -(pred1_softmax + 1e-9).log(), cause it is much larger than entropy itself.
# data represent for the intermediate tensor of shape [1, 192, 384, 1248]
# entropy is the tensor of shape [1, 384, 1248]

>>> data = torch.rand([1, 192, 384, 1248], device='cuda')
>>> torch.cuda.memory_allocated() / 1024 / 1024    # convert to MB
352

>>> entropy = torch.rand([1, 384, 1248], device='cuda')
>>> torch.cuda.memory_allocated() / 1024 / 1024
1.828125