identity | Modular

Python module

No-op layer that forwards inputs unmodified, useful as a placeholder or base case.

Identity layer that passes through input unchanged.

Identity

class max.nn.identity.Identity

source

Identity layer that passes through input unchanged.

This layer is useful for skipping certain operations (like normalization) in specific architectures such as EAGLE speculative decoding, where the draft model receives already-normalized hidden states from the target model.

Example:

>>> from max.nn import Identity
>>> identity = Identity()
>>> # In graph construction:
>>> output = identity(input_tensor)  # output == input_tensor