memory
Functions
Garbage collection Torch (CUDA) memory. |
|
Calculates the size of a Module in megabytes. |
|
|
|
|
|
|
|
|
|
Detach all tensors in in_dict. |
Utilities related to memory.
- pytorch_lightning.utilities.memory.garbage_collection_cuda()[source]
Garbage collection Torch (CUDA) memory.
- Return type
- pytorch_lightning.utilities.memory.get_model_size_mb(model)[source]
Calculates the size of a Module in megabytes.
The computation includes everything in the
state_dict()
, i.e., by default the parameters and buffers.- Return type
- Returns
Number of megabytes in the parameters of the input module.
- pytorch_lightning.utilities.memory.recursive_detach(in_dict, to_cpu=False)[source]
Detach all tensors in in_dict.
May operate recursively if some of the values in in_dict are dictionaries which contain instances of Tensor. Other types in in_dict are not affected by this utility function.