Skip to content

Commit 47ef5cb

Browse files
committed
fix
1 parent f21be8f commit 47ef5cb

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

docs/execution-providers/CoreML-ExecutionProvider.md

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -44,12 +44,14 @@ The CoreML EP must be explicitly registered when creating the inference session.
4444
```C++
4545
Ort::Env env = Ort::Env{ORT_LOGGING_LEVEL_ERROR, "Default"};
4646
Ort::SessionOptions so;
47-
so.AppendExecutionProvider("CoreML", {{"MLComputeUnits", std::to_string("MLProgram")}});
47+
std::unordered_map<std::string, std::string> provider_options;
48+
provider_options["ModelFormat"] = std::to_string("MLProgram");
49+
so.AppendExecutionProvider("CoreML", provider_options);
4850
Ort::Session session(env, model_path, so);
4951
```
5052
51-
> [!WARNING]
52-
> Deprecated APIs `OrtSessionOptionsAppendExecutionProvider_CoreML` in ONNX Runtime 1.20.0. Please use `OrtSessionOptionsAppendExecutionProvider` instead.
53+
54+
**Deprecated** APIs `OrtSessionOptionsAppendExecutionProvider_CoreML` in ONNX Runtime 1.20.0. Please use `OrtSessionOptionsAppendExecutionProvider` instead.
5355
```C++
5456
Ort::Env env = Ort::Env{ORT_LOGGING_LEVEL_ERROR, "Default"};
5557
Ort::SessionOptions so;
@@ -66,8 +68,11 @@ To use the CoreML EP run time options, create an unsigned integer representing t
6668

6769
ProviderOptions can be set by passing the unsigned integer to the `AppendExecutionProvider` method.
6870
```c++
69-
std::unordered_map<std::string, std::string> provider_options =
70-
{{"MLComputeUnits", std::to_string("MLProgram")}};
71+
std::unordered_map<std::string, std::string> provider_options;
72+
provider_options["ModelFormat"] = std::to_string("MLProgram");
73+
provider_options["MLComputeUnits"] = std::to_string("ALL");
74+
provider_options["RequireStaticInputShapes"] = std::to_string("0");
75+
provider_options["EnableOnSubgraphs"] = std::to_string("0");
7176
```
7277
### Available Options (New API)
7378
`ModelFormat` can be one of the following values:
@@ -91,8 +96,6 @@ std::unordered_map<std::string, std::string> provider_options =
9196

9297

9398
## Configuration Options (Old API)
94-
> [!WARNING]
95-
> It's deprecated
9699
```
97100
uint32_t coreml_flags = 0;
98101
coreml_flags |= COREML_FLAG_ONLY_ENABLE_DEVICE_WITH_ANE;

0 commit comments

Comments
 (0)