autocast.encoders.identity#

class IdentityEncoder(in_channels)[source]#

Bases: EncoderWithCond

Identity encoder that passes through input unchanged.

Parameters:

in_channels (int)

channel_axis: int = -1#
encode(batch)[source]#

Encode the input tensor into the latent space.

Parameters:

batch (Batch) – Input batch to be encoded.

Returns:

Encoded tensor in the latent space with shape (B, *, C_latent).

Return type:

Float[Tensor, ‘batch *optional_dims channel’]