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

Function CheckNumericsGrad

tensorflow/cc/gradients/array_grad.cc:204–214  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

202REGISTER_GRADIENT_OP("GatherNd", GatherNdGrad);
203
204Status CheckNumericsGrad(const Scope& scope, const Operation& op,
205 const std::vector<Output>& grad_inputs,
206 std::vector<Output>* grad_outputs) {
207 string message;
208 TF_RETURN_IF_ERROR(GetNodeAttr(op.node()->attrs(), "message", &message));
209 string err_msg = strings::StrCat(
210 "Not a number (NaN) or infinity (Inf) values detected in gradient. ",
211 message);
212 grad_outputs->push_back(CheckNumerics(scope, grad_inputs[0], err_msg));
213 return scope.status();
214}
215REGISTER_GRADIENT_OP("CheckNumerics", CheckNumericsGrad);
216
217Status ReshapeGrad(const Scope& scope, const Operation& op,

Callers

nothing calls this directly

Calls 7

GetNodeAttrFunction · 0.50
StrCatFunction · 0.50
CheckNumericsFunction · 0.50
attrsMethod · 0.45
nodeMethod · 0.45
push_backMethod · 0.45
statusMethod · 0.45

Tested by

no test coverage detected