<!--
{
  "availability" : [
    "iOS: 14.0.0 - 17.4.0",
    "iPadOS: 14.0.0 - 17.4.0",
    "macCatalyst: 14.0.0 - 17.4.0",
    "macOS: 11.0.0 - 14.3.0",
    "tvOS: 14.0.0 - 17.4.0"
  ],
  "documentType" : "symbol",
  "framework" : "MLCompute",
  "identifier" : "/documentation/MLCompute/MLCExecutionOptions/forwardForInference",
  "metadataVersion" : "0.1.0",
  "role" : "Type Property",
  "symbol" : {
    "kind" : "Type Property",
    "modules" : [
      "ML Compute"
    ],
    "preciseIdentifier" : "c:@E@MLCExecutionOptions@MLCExecutionOptionsForwardForInference"
  },
  "title" : "forwardForInference"
}
-->

# forwardForInference

The option to execute the forward pass for inference only.

```
static var forwardForInference: MLCExecutionOptions { get }
```

## Discussion

If you include this option and execute a training graph using one of the `execute` methods, such as [`execute(inputsData:lossLabelsData:lossLabelWeightsData:batchSize:options:completionHandler:)`](/documentation/MLCompute/MLCTrainingGraph/execute(inputsData:lossLabelsData:lossLabelWeightsData:batchSize:options:completionHandler:)), the framework only executes the forward pass of the training graph, and it executes that forward pass for inference only.

If you include this option and execute a training graph using one of the `executeForward` methods, such as [`executeForward(batchSize:options:completionHandler:)`](/documentation/MLCompute/MLCTrainingGraph/executeForward(batchSize:options:completionHandler:)), the framework executes the forward pass for inference only.

---

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)