---
title: MPSNNGradientState
framework: metalperformanceshaders
role: symbol
role_heading: Class
path: metalperformanceshaders/mpsnngradientstate
---

# MPSNNGradientState

A class representing the state of a gradient kernel when it was encoded.

## Declaration

```swift
class MPSNNGradientState
```

## Relationships

### Inherits From

- [MPSState](metalperformanceshaders/mpsstate.md)

### Inherited By

- [MPSCNNBatchNormalizationState](metalperformanceshaders/mpscnnbatchnormalizationstate.md)
- [MPSCNNConvolutionGradientState](metalperformanceshaders/mpscnnconvolutiongradientstate.md)
- [MPSCNNDropoutGradientState](metalperformanceshaders/mpscnndropoutgradientstate.md)
- [MPSCNNGroupNormalizationGradientState](metalperformanceshaders/mpscnngroupnormalizationgradientstate.md)
- [MPSCNNInstanceNormalizationGradientState](metalperformanceshaders/mpscnninstancenormalizationgradientstate.md)

### Conforms To

- [CVarArg](swift/cvararg.md)
- [CustomDebugStringConvertible](swift/customdebugstringconvertible.md)
- [CustomStringConvertible](swift/customstringconvertible.md)
- [Equatable](swift/equatable.md)
- [Hashable](swift/hashable.md)
- [NSObjectProtocol](objectivec/nsobjectprotocol.md)

## See Also

### Instance Methods

- [encode(to:sourceImages:)](metalperformanceshaders/mpsnngraph/encode(to:sourceimages:).md)
- [encode(to:sourceImages:sourceStates:intermediateImages:destinationStates:)](metalperformanceshaders/mpsnngraph/encode(to:sourceimages:sourcestates:intermediateimages:destinationstates:).md)
- [MPSState](metalperformanceshaders/mpsstate.md)
- [MPSNNBinaryGradientState](metalperformanceshaders/mpsnnbinarygradientstate.md)
- [executeAsync(withSourceImages:completionHandler:)](metalperformanceshaders/mpsnngraph/executeasync(withsourceimages:completionhandler:).md)
- [MPSNNGraphCompletionHandler](metalperformanceshaders/mpsnngraphcompletionhandler.md)
- [encodeBatch(to:sourceImages:sourceStates:)](metalperformanceshaders/mpsnngraph/encodebatch(to:sourceimages:sourcestates:).md)
- [encodeBatch(to:sourceImages:sourceStates:intermediateImages:destinationStates:)](metalperformanceshaders/mpsnngraph/encodebatch(to:sourceimages:sourcestates:intermediateimages:destinationstates:).md)
- [readCountForSourceImage(at:)](metalperformanceshaders/mpsnngraph/readcountforsourceimage(at:).md)
- [readCountForSourceState(at:)](metalperformanceshaders/mpsnngraph/readcountforsourcestate(at:).md)
- [reloadFromDataSources()](metalperformanceshaders/mpsnngraph/reloadfromdatasources().md)
