Shortcuts

memory

Functions

garbage_collection_cuda

Garbage collection Torch (CUDA) memory.

is_cuda_out_of_memory

rtype

bool

is_cudnn_snafu

rtype

bool

is_oom_error

rtype

bool

is_out_of_cpu_memory

rtype

bool

recursive_detach

Detach all tensors in in_dict.

Utilities related to memory.

lightning.pytorch.utilities.memory.garbage_collection_cuda()[소스]

Garbage collection Torch (CUDA) memory.

반환 형식

None

lightning.pytorch.utilities.memory.recursive_detach(in_dict, to_cpu=False)[소스]

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.

매개변수
  • in_dict (Any) – Dictionary with tensors to detach

  • to_cpu (bool) – Whether to move tensor to cpu

반환

Dictionary with detached tensors

반환 형식

out_dict