coremlconfig

package
v0.6.12 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 31, 2026 License: MIT Imports: 0 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package coremlconfig provides compute plan analysis and model configuration for CoreML models.

Load a compute plan from a compiled model bundle to inspect which operations target the ANE, GPU, or CPU:

plan, err := coremlconfig.LoadPlan("model.mlmodelc", coremlconfig.PlanOptions{})
if err != nil {
	log.Fatal(err)
}
for _, op := range plan.Operations() {
	fmt.Printf("%-20s device=%-4s cost=%.3f\n",
		op.Name, op.Device, op.Cost)
}

PlanOptions.ComputeUnits controls the target compute unit selection (default: all available units including ANE).

Model Configuration

[NewConfig] creates an MLModelConfiguration with helpers for compute unit selection and private ANE compiler options.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL