<!--
{
  "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/MLCInferenceGraph/execute(inputsData:lossLabelsData:lossLabelWeightsData:outputsData:batchSize:options:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "ML Compute",
      "MLCompute"
    ],
    "preciseIdentifier" : "s:So17MLCInferenceGraphC9MLComputeE7execute10inputsData010lossLabelsF00g12LabelWeightsF007outputsF09batchSize7optionsSo9MLCTensorCSg6result_Sd13executionTimetSDySSSo0oF0CG_ARSgA2SSiSo19MLCExecutionOptionsVtYaKF"
  },
  "title" : "execute(inputsData:lossLabelsData:lossLabelWeightsData:outputsData:batchSize:options:)"
}
-->

# execute(inputsData:lossLabelsData:lossLabelWeightsData:outputsData:batchSize:options:)

Executes the inference graph with the input and output data, batch size, and execution options you specify.

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

## Parameters

`inputsData`

A dictionary that contains input data.

`lossLabelsData`

A dictionary that contains loss label data.

`lossLabelWeightsData`

A dictionary that contains loss label weight data.

`outputsData`

A dictionary that contains output data.

`batchSize`

The batch size.

`options`

The execution options.

## 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)