---
title: "gradientFilter(withSources:)"
framework: metalperformanceshaders
role: symbol
role_heading: Instance Method
path: "metalperformanceshaders/mpsnnforwardlossnode/gradientfilter(withsources:)"
---

# gradientFilter(withSources:)

## Declaration

```swift
func gradientFilter(withSources sourceGradient: [MPSNNImageNode]) -> MPSNNLossGradientNode
```
