<!--
{
  "availability" : [
    "iOS: 11.3.0 -",
    "iPadOS: 11.3.0 -",
    "macCatalyst: 13.0.0 -",
    "macOS: 10.13.4 -",
    "tvOS: 11.3.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "MetalPerformanceShaders",
  "identifier" : "/documentation/MetalPerformanceShaders/MPSCNNGradientKernel/encodeBatch(commandBuffer:sourceGradients:sourceImages:gradientStates:destinationGradients:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Metal Performance Shaders"
    ],
    "preciseIdentifier" : "c:objc(cs)MPSCNNGradientKernel(im)encodeBatchToCommandBuffer:sourceGradients:sourceImages:gradientStates:destinationGradients:"
  },
  "title" : "encodeBatch(commandBuffer:sourceGradients:sourceImages:gradientStates:destinationGradients:)"
}
-->

# encodeBatch(commandBuffer:sourceGradients:sourceImages:gradientStates:destinationGradients:)

```
func encodeBatch(commandBuffer: any MTLCommandBuffer, sourceGradients: [MPSImage], sourceImages: [MPSImage], gradientStates: [MPSState], destinationGradients: [MPSImage])
```

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)