zero.hardware.free_memory

zero.hardware.free_memory()[source]

Free GPU-memory occupied by torch and run the garbage collector.

Warning

There is a small chunk of GPU-memory (occupied by drivers) that is impossible to free. It is a torch “limitation”, so the function inherits this property.

Return type

None