| 390 | } |
| 391 | |
| 392 | Status AddGrad(const Scope& scope, const Operation& op, |
| 393 | const std::vector<Output>& grad_inputs, |
| 394 | std::vector<Output>* grad_outputs) { |
| 395 | // y = x_1 + x_2 |
| 396 | // dy/dx_1 = dy/dx_2 = 1 |
| 397 | auto gx_1 = Identity(scope, grad_inputs[0]); |
| 398 | auto gx_2 = Identity(scope, grad_inputs[0]); |
| 399 | return BinaryGradCommon(scope, op, grad_outputs, gx_1, gx_2); |
| 400 | } |
| 401 | REGISTER_GRADIENT_OP("Add", AddGrad); |
| 402 | REGISTER_GRADIENT_OP("AddV2", AddGrad); |
| 403 |
nothing calls this directly
no test coverage detected