---
title: "resultGradientTensors(for:)"
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/resultgradienttensors(for:)"
---

# resultGradientTensors(for:)

Gets the result gradient tensors for the layer in the training graph you specify.

## Declaration

```swift
func resultGradientTensors(for layer: MLCLayer) -> [MLCTensor]
```

## Parameters

- `layer`: A layer in the training graph.

## Return Value

Return Value An array of tensors.

## See Also

### Inspecting Training Graphs

- [bindOptimizerData(_:deviceData:with:)](mlcompute/mlctraininggraph/bindoptimizerdata(_:devicedata:with:).md)
- [optimizer](mlcompute/mlctraininggraph/optimizer.md)
- [deviceMemorySize](mlcompute/mlctraininggraph/devicememorysize.md)
- [gradientTensor(forInput:)](mlcompute/mlctraininggraph/gradienttensor(forinput:).md)
- [sourceGradientTensors(for:)](mlcompute/mlctraininggraph/sourcegradienttensors(for:).md)
- [gradientData(forParameter:layer:)](mlcompute/mlctraininggraph/gradientdata(forparameter:layer:).md)
