Roblox UtilitiesDevlHub Roblox Documentation

Class

MLSession

NotCreatableNotReplicated
Inherits
Object
Memory category
Instances

A machine-learning inference session that wraps a single loaded model and runs it through MLSession:ForwardAsync().

An MLSession wraps a single loaded neural-network model and runs inference on it. You don't construct a session directly; instead, MLService:CreateSessionAsync() loads a model bundle for a given asset and returns a ready-to-use session. Call ForwardAsync() on that session to run the model's forward pass on your input data and receive its output.

Methods 1#

ForwardAsyncRuns the session's model on the given input and asynchronously returns the model's output.Yields

ForwardAsync(data: Dictionary): Dictionary#

Yields

Runs inference for the session's loaded model.

If the model declares a dynamic output dimension, the call errors. Calling this method on a session with no valid loaded model also errors.

NameTypeDefaultDescription
dataDictionaryA dictionary mapping each of the model's input names to that input's tensor, given as a nested array of numbers matching the input's shape.
Returns
  • Dictionary — A dictionary mapping each of the model's output names to that output's tensor, given as a nested array of numbers matching the output's shape.

Inherited members#

Inherited from Object 6
Properties (2)

ClassName, className

Events (1)

Changed