In [5]: mem_report()
=================================================================
Element type Size Used MEM(MBytes)
Storage on GPU
-----------------------------------------------------------------
Tensor (5,) 0.00
-----------------------------------------------------------------
Total Tensors: 5 Used Memory Space: 0.00 MBytes
-----------------------------------------------------------------
Storage on CPU
-----------------------------------------------------------------
Tensor (10,) 0.00
-----------------------------------------------------------------
Total Tensors: 10 Used Memory Space: 0.00 MBytes
-----------------------------------------------------------------
=================================================================
I cannot reproduce this behavior and see:
Before running your code:
=================================================================
Element type Size Used MEM(MBytes)
Storage on GPU
-----------------------------------------------------------------
-----------------------------------------------------------------
Total Tensors: 0 Used Memory Space: 0.00 MBytes
-----------------------------------------------------------------
Storage on CPU
-----------------------------------------------------------------
-----------------------------------------------------------------
Total Tensors: 0 Used Memory Space: 0.00 MBytes
-----------------------------------------------------------------
=================================================================
After:
=================================================================
Element type Size Used MEM(MBytes)
Storage on GPU
-----------------------------------------------------------------
Tensor (5,) 0.00
-----------------------------------------------------------------
Total Tensors: 5 Used Memory Space: 0.00 MBytes
-----------------------------------------------------------------
Storage on CPU
-----------------------------------------------------------------
-----------------------------------------------------------------
Total Tensors: 0 Used Memory Space: 0.00 MBytes
-----------------------------------------------------------------
=================================================================