towhee.trainer.utils.trainer_utilsΒΆ

Utilities for the Trainer.

Functions

get_last_checkpoint

get_rank

get_world_size

honor_type

Cast a generator to the same type as obj (list, tuple or namedtuple)

is_dist_avail_and_initialized

is_main_process

is_torch_tensor

recursively_apply

Recursively apply a function on a data structure that is a nested list/tuple/dictionary of a given base type.

reduce_value

send_to_device

Recursively sends the elements in a nested list/tuple/dictionary of tensors to a given device.

set_seed

Helper function for reproducible behavior to set the seed in random, numpy, torch.

unwrap_model

Unwraps a model from potential containers (as used in distributed training).

Classes

SchedulerType

An enumeration.

TrainOutput