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

# encode(commandBuffer:sourceImages:labels:destinationImages:)

## Declaration

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