CoreMlDelegate.withOptions constructor

CoreMlDelegate.withOptions({
  1. int enabledDevices = TfLiteCoreMlDelegateEnabledDevices.TfLiteCoreMlDelegateDevicesWithNeuralEngine,
  2. int coremlVersion = 2,
  3. int maxDelegatedPartitions = 0,
  4. int minNodesPerPartition = 2,
})

Implementation

factory CoreMlDelegate.withOptions({
  int enabledDevices = TfLiteCoreMlDelegateEnabledDevices.TfLiteCoreMlDelegateDevicesWithNeuralEngine,
  int coremlVersion = 2,
  int maxDelegatedPartitions = 0,
  int minNodesPerPartition = 2,
}) {
  assert(Platform.isIOS);
  assert(coremlVersion == 2 || coremlVersion == 3);
  final Pointer<TfLiteCoreMlDelegateOptions> options = TfLiteCoreMlDelegateOptions.allocate(
    enabledDevices,
    coremlVersion,
    maxDelegatedPartitions,
    minNodesPerPartition,
  );
  return CoreMlDelegate._create(options: options);
}