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 module

max.pipelines.lib.role_contracts

The inputs and outputs of each role a registered module fills.

An architecture registers a module class per role in modules: a Module (ModuleV3) or a graph-API Module. The framework builds the role’s graph and batches from the contract here, so the module’s forward (__call__ for a graph-API module) takes the role’s inputs and returns its outputs. A ModuleV3 module sees Tensor fields, and a graph-API module TensorValue fields.

Decoder​

DecoderInputsThe inputs of a DECODER module's forward.
DecoderOutputsThe outputs of a DECODER module's forward.

Vision​

VisionInputsThe image embeddings a DECODER merges into its token stream.