---
title: "bindOptimizerData(_:deviceData:with:)"
framework: ML Compute
role: symbol
role_heading: Instance Method
platforms: [iOS 14.0+, iPadOS 14.0+, Mac Catalyst 14.0+, macOS 11.0+, tvOS 14.0+]
path: "mlcompute/mlctraininggraph/bindoptimizerdata(_:devicedata:with:)"
---

# bindOptimizerData(_:deviceData:with:)

Associates the optimizer and device data you specify along with the tensor.

## Declaration

```swift
func bindOptimizerData(_ data: [MLCTensorData], deviceData: [MLCTensorOptimizerDeviceData]?, with tensor: MLCTensor) -> Bool
```

## Parameters

- `data`: The optimizer data that you want to associate with the tensor.
- `deviceData`: The optimizer device data that you want to associate with the tensor.
- `tensor`: The tensor that you want to associate the data with.

## Return Value

Return Value A Boolean value that indicates whether the data successfully associates with the tensor.

## See Also

### Inspecting Training Graphs

- [optimizer](mlcompute/mlctraininggraph/optimizer.md)
- [deviceMemorySize](mlcompute/mlctraininggraph/devicememorysize.md)
- [gradientTensor(forInput:)](mlcompute/mlctraininggraph/gradienttensor(forinput:).md)
- [sourceGradientTensors(for:)](mlcompute/mlctraininggraph/sourcegradienttensors(for:).md)
- [resultGradientTensors(for:)](mlcompute/mlctraininggraph/resultgradienttensors(for:).md)
- [gradientData(forParameter:layer:)](mlcompute/mlctraininggraph/gradientdata(forparameter:layer:).md)
