| 183 | REGISTER_GRADIENT_OP("Sinh", SinhGrad); |
| 184 | |
| 185 | Status CoshGrad(const Scope& scope, const Operation& op, |
| 186 | const std::vector<Output>& grad_inputs, |
| 187 | std::vector<Output>* grad_outputs) { |
| 188 | // y = cosh(x) |
| 189 | // dy/dx = sinh(x) |
| 190 | auto dydx = Sinh(scope, op.input(0)); |
| 191 | // grad(x) = grad(y) * conj(dy/dx) |
| 192 | grad_outputs->push_back( |
| 193 | Mul(scope, grad_inputs[0], ConjugateHelper(scope, dydx))); |
| 194 | return scope.status(); |
| 195 | } |
| 196 | REGISTER_GRADIENT_OP("Cosh", CoshGrad); |
| 197 | |
| 198 | Status TanhGrad(const Scope& scope, const Operation& op, |