Skip to content

fix: Initialize CoreML delegate options to enable all devices#165

Open
anarsultanov wants to merge 1 commit intomrousavy:mainfrom
anarsultanov:coreml-options
Open

fix: Initialize CoreML delegate options to enable all devices#165
anarsultanov wants to merge 1 commit intomrousavy:mainfrom
anarsultanov:coreml-options

Conversation

@anarsultanov
Copy link

TfLiteCoreMlDelegateOptions was declared without any initialization, leaving all its fields (enabled_devices, coreml_version, max_delegated_partitions, min_nodes_per_partition) with indeterminate values. This could cause unpredictable behavior when creating the CoreML delegate.

Unlike the NNAPI and Android GPU delegates which use explicit *Default() initializer functions, the CoreML delegate API doesn't provide one. This fix initializes the struct with TfLiteCoreMlDelegateAllDevices for enabled_devices (so the delegate works on any device that supports CoreML, not just those with a Neural Engine), while zero-initializing the remaining fields, which the delegate creation function handles with sensible internal defaults.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant