---
title: "run(with:feeds:targetOperations:resultsDictionary:)"
framework: metalperformanceshadersgraph
role: symbol
role_heading: Instance Method
path: "metalperformanceshadersgraph/mpsgraph/run(with:feeds:targetoperations:resultsdictionary:)"
---

# run(with:feeds:targetOperations:resultsDictionary:)

Runs the graph for the given feeds and returns the target tensor values in the results dictionary provided by the user.

## Declaration

```swift
func run(with commandQueue: any MTLCommandQueue, feeds: [MPSGraphTensor : MPSGraphTensorData], targetOperations: [MPSGraphOperation]?, resultsDictionary: [MPSGraphTensor : MPSGraphTensorData])
```

## Parameters

- `commandQueue`: CommandQueue passed to exectute the graph on.
- `feeds`: Feeds dictionary for the placeholder tensors.
- `targetOperations`: Operations to be completed at the end of the run.
- `resultsDictionary`: MPSGraphTensors dictionary passed by user, these will be filled with graph output data.

## Discussion

Discussion It also ensures all target operations also executed. This call blocks until execution has completed.
