---
title: "encode(to:sourceImage:batchNormalizationState:destinationImage:)"
framework: metalperformanceshaders
role: symbol
role_heading: Instance Method
path: "metalperformanceshaders/mpscnnbatchnormalization/encode(to:sourceimage:batchnormalizationstate:destinationimage:)"
---

# encode(to:sourceImage:batchNormalizationState:destinationImage:)

## Declaration

```swift
func encode(to commandBuffer: any MTLCommandBuffer, sourceImage: MPSImage, batchNormalizationState: MPSCNNBatchNormalizationState, destinationImage: MPSImage)
```
