The settings for creating or updating a machine learning model.


class MLModelConfiguration : NSObject


Configuring GPU Usage

var preferredMetalDevice: MTLDevice?

The metal device you prefer this model use to make predictions (inference) and update the model.

var allowLowPrecisionAccumulationOnGPU: Bool

A Boolean value that determines whether to allow low-precision accumulation on a GPU.


Allowing Access to Processing Units

var computeUnits: MLComputeUnits

The processing unit or units the model uses to make predictions.

enum MLComputeUnits

The set of processing-unit configurations the model can use to make predictions.

Supporting Types

class MLParameterKey

A key for model and update parameter dictionaries.



Inherits From

See Also

Creating a Model

init(contentsOf: URL)

Creates a Core ML model object from a compiled model file.

init(contentsOf: URL, configuration: MLModelConfiguration)

Creates a Core ML model object from a compiled model file and a custom configuration.

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software