MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / AtanhGrad

Function AtanhGrad

tensorflow/cc/gradients/math_grad.cc:240–251  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

238REGISTER_GRADIENT_OP("Acosh", AcoshGrad);
239
240Status AtanhGrad(const Scope& scope, const Operation& op,
241 const std::vector<Output>& grad_inputs,
242 std::vector<Output>* grad_outputs) {
243 // y = atanh(x)
244 // dy/dx = 1 / (1 - x^2)
245 auto one = Cast(scope, Const(scope, 1.0), op.input(0).type());
246 auto dydx = Reciprocal(scope, Sub(scope, one, Square(scope, op.input(0))));
247 // grad(x) = grad(y) * conj(dy/dx)
248 grad_outputs->push_back(
249 Mul(scope, grad_inputs[0], ConjugateHelper(scope, dydx)));
250 return scope.status();
251}
252REGISTER_GRADIENT_OP("Atanh", AtanhGrad);
253
254Status Atan2Grad(const Scope& scope, const Operation& op,

Callers

nothing calls this directly

Calls 11

ConjugateHelperFunction · 0.85
typeMethod · 0.65
CastFunction · 0.50
ConstFunction · 0.50
ReciprocalFunction · 0.50
SubFunction · 0.50
SquareFunction · 0.50
MulFunction · 0.50
inputMethod · 0.45
push_backMethod · 0.45
statusMethod · 0.45

Tested by

no test coverage detected