Reducer

class Reducer[source]

Bases: Module, ABC

Abstract base class for the recording of inputs over time.

abstract clear(**kwargs) None[source]

Reinitializes the reducer’s state.

abstract dump(*args, **kwargs) Tensor | None[source]

Returns the reducer’s state over all observations.

forward(*inputs: Tensor, **kwargs) None[source]

Initializes state and incorporates inputs into the reducer’s state.

property latest: Tensor

Return’s the reducer’s current state.

If peek() has multiple options, this should be considered as the default. Unless overridden, peek() is called without arguments.

Returns:

reducer’s current state.

Return type:

torch.Tensor

abstract peek(*args, **kwargs) Tensor | None[source]

Returns the reducer’s current state.

abstract push(inputs: Tensor, **kwargs) None[source]

Incorporates inputs into the reducer’s state.

abstract view(*args, **kwargs) Tensor | None[source]

Returns the reducer’s state at a given time.