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 function

logits_outputs

logits_outputs()​

max.nn.transformer.logits_outputs(next_token_logits, logits, logit_offsets, return_hidden_states, hidden_states)

source

Names a decoder’s outputs, in the order the graph returns them.

Parameters:

  • next_token_logits (TensorValue | None) – Each sequence’s last-token logits, or None when the caller only wants the variable logits.
  • logits (TensorValue | None) – The requested logits beyond the last token, if any.
  • logit_offsets (TensorValue | None) – Where each sequence’s rows start in logits.
  • return_hidden_states (ReturnHiddenStates) – Which hidden states hidden_states holds, which names them.
  • hidden_states (Sequence[TensorValue]) – The hidden states extract_hs() returned.

Returns:

The logits group, then a hidden_states group when there are any.

Return type:

DecoderOutputs