---
title: "encode(commandBuffer:sourceImage:labels:destinationImage:)"
framework: metalperformanceshaders
role: symbol
role_heading: Instance Method
path: "metalperformanceshaders/mpscnnyololoss/encode(commandbuffer:sourceimage:labels:destinationimage:)"
---

# encode(commandBuffer:sourceImage:labels:destinationImage:)

## Declaration

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