>>> out = torch.randn(100,100)
>>> out.cuda()
>>> torch.cuda.memory_allocated(0)
40448
>>> out1 = torch.randn(100,100)
>>> torch.cuda.memory_allocated(0)
0

Why is this happening? I expected the output of totorch.cuda.memory_allocated(0) be 40448 still, because out1 is totally different to out .
Note that,
>>> id(out)
139989884735632
>>> id(out1)
139989884693456

Note2
>>> out = torch.randn(100,100)
>>> out.cuda()
>>> out1 = torch.randn(90,90)
>>> torch.cuda.memory_allocated(0)
40448