---
title: "init(device:lossImageSize:labelsImage:weightsImage:)"
framework: metalperformanceshaders
role: symbol
role_heading: Initializer
path: "metalperformanceshaders/mpscnnlosslabels/init(device:lossimagesize:labelsimage:weightsimage:)"
---

# init(device:lossImageSize:labelsImage:weightsImage:)

## Declaration

```swift
init(device: any MTLDevice, lossImageSize: MTLSize, labelsImage: MPSImage, weightsImage: MPSImage?)
```
