---
title: "execute(inputsData:lossLabelsData:lossLabelWeightsData:outputsData:batchSize:options:)"
framework: ML Compute
role: symbol
role_heading: Instance Method
platforms: [iOS 15.0+, iPadOS 15.0+, Mac Catalyst 15.0+, macOS 12.0+, tvOS 15.0+]
path: "mlcompute/mlcinferencegraph/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.

## Declaration

```swift
@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

Return Value The result tensor, if any, and the execution time if you specify profiling.

## See Also

### Executing Inference Graphs

- [execute(inputsData:batchSize:options:completionHandler:)](mlcompute/mlcinferencegraph/execute(inputsdata:batchsize:options:completionhandler:).md)
- [execute(inputsData:outputsData:batchSize:options:completionHandler:)](mlcompute/mlcinferencegraph/execute(inputsdata:outputsdata:batchsize:options:completionhandler:).md)
- [execute(inputsData:lossLabelsData:lossLabelWeightsData:batchSize:options:completionHandler:)](mlcompute/mlcinferencegraph/execute(inputsdata:losslabelsdata:losslabelweightsdata:batchsize:options:completionhandler:).md)
- [execute(inputsData:lossLabelsData:lossLabelWeightsData:outputsData:batchSize:options:completionHandler:)](mlcompute/mlcinferencegraph/execute(inputsdata:losslabelsdata:losslabelweightsdata:outputsdata:batchsize:options:completionhandler:).md)
- [MLCExecutionOptions](mlcompute/mlcexecutionoptions.md)
- [MLCGraphCompletionHandler](mlcompute/mlcgraphcompletionhandler.md)
