Mojo package
engine
APIs to run inference with MAX Engine.
Although there are several modules in this max.engine
package, you'll get
everything you need from this top-level engine
namespace, so you don't need
to import each module.
For example, the basic code you need to run an inference looks like this:
from max import engine
def main():
# Load your model:
var session = engine.InferenceSession()
var model = session.load(model_path)
# Get the inputs, then run an inference:
var outputs = model.execute(inputs)
# Process the outputs here.
from max import engine
def main():
# Load your model:
var session = engine.InferenceSession()
var model = session.load(model_path)
# Get the inputs, then run an inference:
var outputs = model.execute(inputs)
# Process the outputs here.
Modules
-
info
: Provides information about MAX Engine, such as the version. -
model
: Defines theModel
type that holds a model ready for execution. -
session
: Defines theInferenceSession
type that serves as an entry point to MAX Engine. -
shape_element
: ShapeElement API. See ShapeElement struct definition for details. -
tensor
: Defines different data formats you can use to pass inputs to MAX Engine when executing a model.