For the complete documentation index, see llms.txt. Markdown versions of all pages are available by appending .md to any URL (e.g. /get-started.md).
Python class
EncoderInputs
EncoderInputs
class max.pipelines.lib.registration_encoder.EncoderInputs(*, tokens, attention_mask=None, input_row_offsets=None, return_n_logits=None)
Bases: Generic[TensorT]
The inputs of an ENCODER module’s __call__.
A field that is None is not a graph input: a padded encoder takes
attention_mask, and a ragged one input_row_offsets and
return_n_logits.
-
Parameters:
-
- tokens (TensorT)
- attention_mask (TensorT | None)
- input_row_offsets (TensorT | None)
- return_n_logits (TensorT | None)
attention_mask
attention_mask: TensorT | None = None
1.0 for a real token and 0.0 for padding,
[batch_size, seq_len], for a padded encoder.
input_row_offsets
input_row_offsets: TensorT | None = None
Each sequence’s start in tokens, for a ragged encoder.
return_n_logits
return_n_logits: TensorT | None = None
The ragged batch’s logit count, which an encoder ignores; the graph takes it so a ragged encoder’s inputs match a decoder’s.
tokens
tokens: TensorT
The token IDs: [batch_size, seq_len] padded, or
[total_seq_len] ragged.