---
title: "trainingGraph(withSourceGradient:nodeHandler:)"
framework: metalperformanceshaders
role: symbol
role_heading: Instance Method
path: "metalperformanceshaders/mpsnnfilternode/traininggraph(withsourcegradient:nodehandler:)"
---

# trainingGraph(withSourceGradient:nodeHandler:)

## Declaration

```swift
func trainingGraph(withSourceGradient gradientImage: MPSNNImageNode?, nodeHandler: MPSGradientNodeBlock? = nil) -> [MPSNNFilterNode]?
```
