Skip to main content

Python class

CompiledModel

CompiledModel

class max.engine.CompiledModel(handle, expected_weights)

source

Bases: object

A compiled model artifact, ready for initialization with weights.

Returned by InferenceSession.compile(). Pass it to InferenceSession.init() or InferenceSession.init_all() to produce executable Model instances.

A CompiledModel is not directly executable: compilation is independent of the device-memory allocations performed during initialization, so a single artifact can be initialized more than once.

Parameters: