IMPORTANT: To view this page as Markdown, append `.md` to the URL (e.g. /get-started.md). For the complete documentation index, see llms.txt.
Skip to main content
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)

source

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

source

Hidden states, when the model returns them.

logit_offsets​

logit_offsets: _OutputTensorT | None = None

source

Row offsets into logits, shape [B + 1]; set with it.

logits​

logits: _OutputTensorT | None = None

source

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

source

Last-token logits, shape [B, V].

state​

state: tuple[_OutputTensorT, ...] | None = None

source

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.