MCPcopy Create free account
hub / github.com/pytorch/pytorch / RegisterGradient

Method RegisterGradient

caffe2/python/core.py:1112–1119  ·  view source on GitHub ↗

A decorator for registering gradient mappings.

(cls, op_type)

Source from the content-addressed store, hash-verified

1110
1111 @classmethod
1112 def RegisterGradient(cls, op_type):
1113 """A decorator for registering gradient mappings."""
1114
1115 def Wrapper(func):
1116 cls.gradient_registry_[op_type] = func
1117 return func
1118
1119 return Wrapper
1120
1121 @classmethod
1122 def _GetGradientForOpCC(cls, op_def, g_output):

Callers 1

core.pyFile · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected