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

Executor

Executor​

class max.experimental.executor.Executor(*args, **kwargs)

source

Bases: Protocol

Contract for running a finalized eager graph against input buffers.

execute()​

execute(graph, inputs)

source

Execute graph with inputs and return output buffers.

Parameters:

  • graph (Graph) – A finalized graph ready for execution. The executor may mutate the module internally (for example, to apply lowering passes); callers must not use the module after this call returns.
  • inputs (Sequence[Buffer]) – Buffers corresponding to graph.inputs, in order. Mutable BufferType inputs are mutated in place; the returned sequence covers declared graph outputs only.

Returns:

Output buffers in the order declared by graph.output.

Raises:

UnsupportedGraphError – If the executor statically refuses the graph before any execution begins.

Return type:

Sequence[Buffer | None]