<!--
{
  "availability" : [
    "iOS: 14.0.0 - 17.4.0",
    "iPadOS: 14.0.0 - 17.4.0",
    "macCatalyst: 14.0.0 - 17.4.0",
    "macOS: 11.0.0 - 14.3.0",
    "tvOS: 14.0.0 - 17.4.0"
  ],
  "documentType" : "symbol",
  "framework" : "MLCompute",
  "identifier" : "/documentation/MLCompute/MLCTrainingGraph/bindOptimizerData(_:deviceData:with:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "ML Compute"
    ],
    "preciseIdentifier" : "c:objc(cs)MLCTrainingGraph(im)bindOptimizerData:deviceData:withTensor:"
  },
  "title" : "bindOptimizerData(_:deviceData:with:)"
}
-->

# bindOptimizerData(_:deviceData:with:)

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

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

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

## Discussion

---

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)