Skip to main content

Python class

Identity

Identity

class max.nn.Identity

source

Bases: Module

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.

When called, Identity accepts a TensorValue and returns the same tensor unchanged.

from max.nn import Identity

identity = Identity()
output = identity(input_tensor)  # output == input_tensor