| 414 | REGISTER_GRADIENT_OP("Sub", SubGrad); |
| 415 | |
| 416 | Status 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 | } |
| 428 | REGISTER_GRADIENT_OP("Mul", MulGrad); |
| 429 | |
| 430 | Status DivGrad(const Scope& scope, const Operation& op, |
nothing calls this directly
no test coverage detected