Contents

MLModelStructure

An enum representing the structure of a model.

Declaration

enum MLModelStructure

Overview

// 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.
}

Topics

Model structures

Loading a model structure

See Also

Compute plan