---
title: "scalarWeight(forSourceImage:destinationImage:)"
framework: metalperformanceshaders
role: symbol
role_heading: Instance Method
path: "metalperformanceshaders/mpsnnlosscallback/scalarweight(forsourceimage:destinationimage:)"
---

# scalarWeight(forSourceImage:destinationImage:)

## Declaration

```swift
func scalarWeight(forSourceImage sourceImage: MPSImage, destinationImage: MPSImage) -> Float
```
