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

VisionInputs

VisionInputs​

class max.pipelines.lib.role_contracts.VisionInputs(*, embeddings, scatter_indices)

source

Bases: Generic[_LeafT]

The image embeddings a DECODER merges into its token stream.

The framework passes them when a VISION module is registered. On a batch without new images both are empty.

Parameters:

  • embeddings (_LeafT)
  • scatter_indices (_LeafT)

embeddings​

embeddings: _LeafT

source

The encoded images, shape [num_image_tokens, hidden_size], replicated on every device of the decoder’s mesh.

scatter_indices​

scatter_indices: _LeafT

source

Each embedding row’s position in the decoder’s tokens, shape [num_image_tokens], replicated like embeddings.