One Logo Pool Ball
CoreML · IOS API REFERENCE

MLModelStructure

enum · iOS 17.4+ · SDK 27.1

enum MLModelStructure

An enum representing the structure of a model. ``` // Load the model structure. let modelStructure = await try MLModelStructure.load(contentsOf: modelURL) switch modelStructure { case .program(let program): // Examine ML Program model. case .neuralNetwork(let neuralNetwork): // Examine Neural network model case .pipeline(let pipeline) // Examine Pipeline model default: // The model type is something else. } ```

Members (2)

static · iOS 17.4+

load

TypeScript
static loadContentsOf(url: string): Promise<MLModelStructure>
Swift declaration
static func load(contentsOf url: URL) async throws -> MLModelStructure

Load the model structure asynchronously given the location of its on-disk representation. - Parameters: - url: The location of its on-disk representation (.mlmodelc directory).

static · iOS 17.4+

load

TypeScript
static loadAsset(asset: MLModelAsset): Promise<MLModelStructure>
Swift declaration
static func load(asset: MLModelAsset) async throws -> MLModelStructure

Load the model structure asynchronously from the model asset. - Parameters: - asset: The model asset.

Skipped declarations

No declarations were skipped in this snapshot.

All CoreML types →