<!--
{
  "availability" : [
    "iOS: 18.0.0 -",
    "iPadOS: 18.0.0 -",
    "macCatalyst: -",
    "macOS: 15.0.0 -",
    "tvOS: 18.0.0 -",
    "visionOS: -",
    "watchOS: 11.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Accelerate",
  "identifier" : "/documentation/Accelerate/BNNSGraph/Context/init(compileFromPath:functionName:options:)-3nn5g",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "Accelerate"
    ],
    "preciseIdentifier" : "s:10Accelerate9BNNSGraphO7ContextC15compileFromPath12functionName7optionsAESS_SSSgAC14CompileOptionsVtYaKcfc"
  },
  "title" : "init(compileFromPath:functionName:options:)"
}
-->

# init(compileFromPath:functionName:options:)

Returns a new context that wraps a graph object which represents the compiled `.mlmodelc` file.

```
init(compileFromPath path: String, functionName: String? = nil, options: BNNSGraph.CompileOptions = CompileOptions()) async throws
```

## Parameters

`path`

The path to the `.mlmodelc` program file.

`functionName`

The name of a specific function to be compiled. Pass `nil` to specify that the function compiles all functions.

`options`

The compilation options.

## Discussion> SeeAlso: `BNNSGraphCompileFromFile`

> SeeAlso: `BNNSGraphContextMake`

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)