use torch.no_grad() will only disable gradient, but entropy is still in GPU. You can use following code to profile you GPU memory usage.
import torch as t

data = t.rand(1, 192, 384, 1248)
print(t.cuda.memory_reserved(0))
data = data.cuda()
print(t.cuda.memory_reserved(0))
data = t.softmax(data, -1)
print(t.cuda.memory_reserved(0))
data.requires_grad = True
print(t.cuda.memory_reserved(0))
# entropy = t.sum(-(data + 1e-9).log() * data, dim=1)
# print(t.cuda.memory_reserved(0))
# del entropy
# print(t.cuda.memory_reserved(0))
with t.no_grad():
    entropy = t.sum(-(data + 1e-9).log() * data, dim=1)
    print(t.cuda.memory_reserved(0))