MCPcopy Index your code
hub / github.com/pytorch/pytorch / AddDirectGradient

Function AddDirectGradient

caffe2/python/core_gradients_test.py:43–49  ·  view source on GitHub ↗
(op, g_output)

Source from the content-addressed store, hash-verified

41# First gradient: (in -> out) leading to (out_grad -> in_grad)
42@GradientRegistry.RegisterGradient('Direct')
43def AddDirectGradient(op, g_output):
44 return (
45 CopyDeviceOption(
46 CreateOperator('DirectGradient', NeedAll(op, g_output), GIS(op)),
47 op),
48 GIS(op)
49 )
50
51
52# Second gradient: (in -> out) leading to (out, out_grad -> in_grad)

Callers

nothing calls this directly

Calls 4

CreateOperatorFunction · 0.90
CopyDeviceOptionFunction · 0.85
NeedAllFunction · 0.85
GISFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…