Python class
Identity
Identity
class max.nn.Identity
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_tensorWas this page helpful?
Thank you! We'll create more content like this.
Thank you for helping us improve!