composer.algorithms.channels_last.channels_last#

composer.algorithms.channels_last.channels_last

Functions

apply_channels_last

Changes the memory format of the model to torch.channels_last.

Classes

Algorithm

Base class for algorithms.

ChannelsLast

Changes the memory format of the model to torch.channels_last.

Event

Enum to represent events in the training loop.

Logger

Logger routes metrics to the LoggerCallback.

State

The state of the trainer.

Attributes

  • Optional

  • annotations

  • log

class composer.algorithms.channels_last.channels_last.ChannelsLast[source]#

Bases: composer.core.algorithm.Algorithm

Changes the memory format of the model to torch.channels_last. This usually yields improved GPU utilization.

Runs on Event.INIT, so it can set the memory format before the model is DDP wrapped. Has no hyperparameters.

apply(event, state, logger)[source]#

Changes the memory format of the model to torch.channels_last

match(event, state)[source]#

Runs on Event.INIT

composer.algorithms.channels_last.channels_last.apply_channels_last(model)[source]#

Changes the memory format of the model to torch.channels_last.

This usually yields improved GPU utilization.

Parameters

model โ€“ model or module to modify