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

Method _AppendAutoGradGenerator

caffe2/python/core.py:980–989  ·  view source on GitHub ↗
(self, y, grad, autograd_op)

Source from the content-addressed store, hash-verified

978 return additional_sum_ops, grad_map
979
980 def _AppendAutoGradGenerator(self, y, grad, autograd_op):
981 # Gradient here is not sparse as it was generated by
982 # a ConstantFill operator. Autogeneration for sparse gradients is
983 # not supported
984 generator = GradGenMeta(
985 autograd_op, 0 if autograd_op else None, str(grad),
986 autograd_op.device_option)
987
988 self.gradient_generators[str(y)][self.frontier[str(y)]].append(
989 generator)
990
991 AUTOGEN_GRAD_SUFFIX = "_autogen_grad"
992

Callers 1

_GetInitGradientsMethod · 0.95

Calls 1

appendMethod · 0.45

Tested by

no test coverage detected