<!--
{
  "availability" : [
    "iOS: 15.0.0 - 17.0.0",
    "iPadOS: 15.0.0 - 17.0.0",
    "macCatalyst: 15.0.0 - 17.0.0",
    "macOS: 12.0.0 - 14.0.0",
    "tvOS: 15.0.0 - 17.0.0"
  ],
  "documentType" : "symbol",
  "framework" : "MLCompute",
  "identifier" : "/documentation/MLCompute/MLCTrainingGraph/executeForward(batchSize:options:outputsData:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "ML Compute",
      "MLCompute"
    ],
    "preciseIdentifier" : "s:So16MLCTrainingGraphC9MLComputeE14executeForward9batchSize7options11outputsDataSo9MLCTensorCSg6result_Sd13executionTimetSi_So19MLCExecutionOptionsVSDySSSo0kJ0CGSgtYaKF"
  },
  "title" : "executeForward(batchSize:options:outputsData:)"
}
-->

# executeForward(batchSize:options:outputsData:)

Executes the forward pass of the training graph with the batch size, execution options, and output data you specify.

```
@discardableResult func executeForward(batchSize: Int, options: MLCExecutionOptions = [], outputsData: [String : MLCTensorData]? = nil) async throws -> (result: MLCTensor?, executionTime: TimeInterval)
```

## Parameters

`batchSize`

The batch size.

`options`

The execution options.

`outputsData`

A dictionary that contains output data.

## Return Value

The result tensor, if any, and the execution time if you specify [`profiling`](/documentation/MLCompute/MLCExecutionOptions/profiling).

---

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)