| 402 | REGISTER_GRADIENT_OP("AddV2", AddGrad); |
| 403 | |
| 404 | Status SubGrad(const Scope& scope, const Operation& op, |
| 405 | const std::vector<Output>& grad_inputs, |
| 406 | std::vector<Output>* grad_outputs) { |
| 407 | // y = x_1 - x_2 |
| 408 | // dy/dx_1 = 1 |
| 409 | // dy/dx_2 = -1 |
| 410 | auto gx_1 = Identity(scope, grad_inputs[0]); |
| 411 | auto gx_2 = Neg(scope, grad_inputs[0]); |
| 412 | return BinaryGradCommon(scope, op, grad_outputs, gx_1, gx_2); |
| 413 | } |
| 414 | REGISTER_GRADIENT_OP("Sub", SubGrad); |
| 415 | |
| 416 | Status MulGrad(const Scope& scope, const Operation& op, |
nothing calls this directly
no test coverage detected