---
title: "bindOptimizerData(_:deviceData:)"
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/mlctensor/bindoptimizerdata(_:devicedata:)"
---

# bindOptimizerData(_:deviceData:)

Associates the optimizer and device data buffers you specify to the tensor.

## Declaration

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

## Parameters

- `data`: An array that contains the optimizer data to associate with the tensor.
- `deviceData`: An array that contains the optimizer device data to associate with the tensor.

## Return Value

Return Value true if the framework successfully associated the data and device data with the tensor; otherwise, false.

## See Also

### Managing Tensor Data

- [synchronizeData()](mlcompute/mlctensor/synchronizedata().md)
- [synchronizeOptimizerData()](mlcompute/mlctensor/synchronizeoptimizerdata().md)
- [copyDataFromDeviceMemory(toBytes:length:synchronizeWithDevice:)](mlcompute/mlctensor/copydatafromdevicememory(tobytes:length:synchronizewithdevice:).md)
- [bindAndWriteData(_:to:)](mlcompute/mlctensor/bindandwritedata(_:to:).md)
