Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
wejoncy committed Nov 27, 2024
1 parent f21be8f commit 47ef5cb
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions docs/execution-providers/CoreML-ExecutionProvider.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,14 @@ The CoreML EP must be explicitly registered when creating the inference session.
```C++
Ort::Env env = Ort::Env{ORT_LOGGING_LEVEL_ERROR, "Default"};
Ort::SessionOptions so;
so.AppendExecutionProvider("CoreML", {{"MLComputeUnits", std::to_string("MLProgram")}});
std::unordered_map<std::string, std::string> provider_options;
provider_options["ModelFormat"] = std::to_string("MLProgram");
so.AppendExecutionProvider("CoreML", provider_options);
Ort::Session session(env, model_path, so);
```
> [!WARNING]
> Deprecated APIs `OrtSessionOptionsAppendExecutionProvider_CoreML` in ONNX Runtime 1.20.0. Please use `OrtSessionOptionsAppendExecutionProvider` instead.
**Deprecated** APIs `OrtSessionOptionsAppendExecutionProvider_CoreML` in ONNX Runtime 1.20.0. Please use `OrtSessionOptionsAppendExecutionProvider` instead.
```C++
Ort::Env env = Ort::Env{ORT_LOGGING_LEVEL_ERROR, "Default"};
Ort::SessionOptions so;
Expand All @@ -66,8 +68,11 @@ To use the CoreML EP run time options, create an unsigned integer representing t

ProviderOptions can be set by passing the unsigned integer to the `AppendExecutionProvider` method.
```c++
std::unordered_map<std::string, std::string> provider_options =
{{"MLComputeUnits", std::to_string("MLProgram")}};
std::unordered_map<std::string, std::string> provider_options;
provider_options["ModelFormat"] = std::to_string("MLProgram");
provider_options["MLComputeUnits"] = std::to_string("ALL");
provider_options["RequireStaticInputShapes"] = std::to_string("0");
provider_options["EnableOnSubgraphs"] = std::to_string("0");
```
### Available Options (New API)
`ModelFormat` can be one of the following values:
Expand All @@ -91,8 +96,6 @@ std::unordered_map<std::string, std::string> provider_options =


## Configuration Options (Old API)
> [!WARNING]
> It's deprecated
```
uint32_t coreml_flags = 0;
coreml_flags |= COREML_FLAG_ONLY_ENABLE_DEVICE_WITH_ANE;
Expand Down

0 comments on commit 47ef5cb

Please sign in to comment.