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
ModuleV3Outputs
ModuleV3Outputs
class max.pipelines.lib.ModuleV3Outputs(next_token_logits, logits=None, logit_offsets=None, hidden_states=None, state=None)
Bases: Generic[_OutputTensorT]
The outputs a ModuleV3 text model’s forward returns.
ModuleV3PipelineModelWithKVCache maps each field to the
ModelOutputs field of the same name. A field left None is not
a graph output. A registered graph-API decoder returns the same fields as
TensorValue.
-
Parameters:
-
- next_token_logits (_OutputTensorT)
- logits (_OutputTensorT | None)
- logit_offsets (_OutputTensorT | None)
- hidden_states (_OutputTensorT | None)
- state (tuple[_OutputTensorT, ...] | None)
hidden_states
hidden_states: _OutputTensorT | None = None
Hidden states, when the model returns them.
logit_offsets
logit_offsets: _OutputTensorT | None = None
Row offsets into logits, shape [B + 1]; set with it.
logits
logits: _OutputTensorT | None = None
All or variable logits, shape [T, V], when the model returns them.
When None, next_token_logits also serves as
ModelOutputs.logits.
next_token_logits
next_token_logits: _OutputTensorT
Last-token logits, shape [B, V].
state
The per-request state a registered decoder returns for its next step,
in the order its store declares (see
request_state). A decoder whose state the graph
updates in place returns none.