---
title: "encode(commandBuffer:batchNormalizationState:inputMomentumVectors:inputVelocityVectors:resultState:)"
framework: metalperformanceshaders
role: symbol
role_heading: Instance Method
path: "metalperformanceshaders/mpsnnoptimizeradam/encode(commandbuffer:batchnormalizationstate:inputmomentumvectors:inputvelocityvectors:resultstate:)"
---

# encode(commandBuffer:batchNormalizationState:inputMomentumVectors:inputVelocityVectors:resultState:)

## Declaration

```swift
func encode(commandBuffer: any MTLCommandBuffer, batchNormalizationState: MPSCNNBatchNormalizationState, inputMomentumVectors: [MPSVector]?, inputVelocityVectors: [MPSVector]?, resultState: MPSCNNNormalizationGammaAndBetaState)
```
