PerformanceConfig class

Configuration for interpreter hardware acceleration and threading.

Constructors

PerformanceConfig({PerformanceMode mode = PerformanceMode.auto, int? numThreads})
Creates a performance config with the given mode and optional numThreads.
const
PerformanceConfig.auto({int? numThreads})
Creates a config that uses InterpreterFactory's auto-mode mapping.
const
PerformanceConfig.coreml({int? numThreads})
Creates a CoreML-accelerated config.
const
PerformanceConfig.gpu({int? numThreads})
Creates a GPU-accelerated config.
const
PerformanceConfig.xnnpack({int? numThreads})
Creates an XNNPACK-accelerated config.
const

Properties

hashCode int
The hash code for this object.
no setterinherited
mode PerformanceMode
The hardware acceleration mode.
final
numThreads int?
Number of threads for inference. Defaults to min(4, CPU count) if null.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Constants

disabled → const PerformanceConfig
A config with no hardware acceleration.