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

Function SafeDivHelper

tensorflow/cc/gradients/math_grad.cc:633–635  ·  view source on GitHub ↗

Integer division x / y, assuming x and y >=0, but treats x/0 = x

Source from the content-addressed store, hash-verified

631
632// Integer division x / y, assuming x and y >=0, but treats x/0 = x
633Output SafeDivHelper(const Scope& scope, const Output& x, const Output& y) {
634 return Div(scope, x, Maximum(scope, y, Const(scope, 1)));
635}
636
637// Helper function for reduction ops.
638//

Callers 3

SumGradHelperFunction · 0.85
MeanGradFunction · 0.85
ProdGradFunction · 0.85

Calls 3

DivFunction · 0.50
MaximumClass · 0.50
ConstFunction · 0.50

Tested by

no test coverage detected