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

# encode(commandBuffer:sourceImage:labels:)

## Declaration

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