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

# gradientFilter(withSource:)

## Declaration

```swift
func gradientFilter(withSource sourceGradient: MPSNNImageNode) -> MPSNNLossGradientNode
```
