---
title: "encode(commandBuffer:sourceImages:labels:)"
framework: metalperformanceshaders
role: symbol
role_heading: Instance Method
path: "metalperformanceshaders/mpscnnloss/encode(commandbuffer:sourceimages:labels:)"
---

# encode(commandBuffer:sourceImages:labels:)

## Declaration

```swift
func encode(commandBuffer: any MTLCommandBuffer, sourceImages sourceImage: [MPSImage], labels: [MPSCNNLossLabels]) -> [MPSImage]
```
