| 587 | REGISTER_GRADIENT_OP("Real", RealGrad); |
| 588 | |
| 589 | Status ImagGrad(const Scope& scope, const Operation& op, |
| 590 | const std::vector<Output>& grad_inputs, |
| 591 | std::vector<Output>* grad_outputs) { |
| 592 | auto zero = Cast(scope, Const(scope, 0.0), op.output(0).type()); |
| 593 | auto dx = Complex(scope, zero, grad_inputs[0]); |
| 594 | grad_outputs->push_back(dx); |
| 595 | return scope.status(); |
| 596 | } |
| 597 | REGISTER_GRADIENT_OP("Imag", ImagGrad); |
| 598 | |
| 599 | Status ComplexGrad(const Scope& scope, const Operation& op, |