MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / MulGrad

Function MulGrad

tensorflow/cc/gradients/math_grad.cc:416–427  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

414REGISTER_GRADIENT_OP("Sub", SubGrad);
415
416Status MulGrad(const Scope& scope, const Operation& op,
417 const std::vector<Output>& grad_inputs,
418 std::vector<Output>* grad_outputs) {
419 auto x_1 = ConjugateHelper(scope, op.input(0));
420 auto x_2 = ConjugateHelper(scope, op.input(1));
421 // y = x_1 * x_2
422 // dy/dx_1 = x_2
423 // dy/dx_2 = x_1
424 auto gx_1 = Mul(scope, grad_inputs[0], x_2);
425 auto gx_2 = Mul(scope, grad_inputs[0], x_1);
426 return BinaryGradCommon(scope, op, grad_outputs, gx_1, gx_2);
427}
428REGISTER_GRADIENT_OP("Mul", MulGrad);
429
430Status DivGrad(const Scope& scope, const Operation& op,

Callers

nothing calls this directly

Calls 4

ConjugateHelperFunction · 0.85
BinaryGradCommonFunction · 0.85
MulFunction · 0.50
inputMethod · 0.45

Tested by

no test coverage detected