---
title: "encodeBatch(to:sourceGradients:sourceImages:batchNormalizationState:destinationGradients:)"
framework: metalperformanceshaders
role: symbol
role_heading: Instance Method
path: "metalperformanceshaders/mpscnnbatchnormalizationgradient/encodebatch(to:sourcegradients:sourceimages:batchnormalizationstate:destinationgradients:)"
---

# encodeBatch(to:sourceGradients:sourceImages:batchNormalizationState:destinationGradients:)

## Declaration

```swift
func encodeBatch(to commandBuffer: any MTLCommandBuffer, sourceGradients: [MPSImage], sourceImages: [MPSImage], batchNormalizationState: MPSCNNBatchNormalizationState, destinationGradients: [MPSImage])
```
