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

Function IsPosInf

tensorflow/compiler/xla/client/lib/math.cc:99–108  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

97}
98
99XlaOp IsPosInf(XlaOp operand) {
100 auto& b = *operand.builder();
101 return b.ReportErrorOrReturn([&]() -> StatusOr<XlaOp> {
102 TF_RETURN_IF_ERROR(EnsureOperandIsRealFp("IsPosInf", operand));
103 TF_ASSIGN_OR_RETURN(auto shape, b.GetShape(operand));
104 // Note that this is only correct for floating-point types. If we wanted it
105 // to be correct for all types, we'd need to Gt(MaxFiniteValue).
106 return Eq(operand, MaxValue(&b, shape.element_type()));
107 });
108}
109
110XlaOp IsNegInf(XlaOp operand) {
111 auto& b = *operand.builder();

Callers 2

IsInfFunction · 0.85
TestIsInfOrNanMethod · 0.85

Calls 6

EnsureOperandIsRealFpFunction · 0.85
MaxValueFunction · 0.85
ReportErrorOrReturnMethod · 0.80
EqFunction · 0.50
builderMethod · 0.45
element_typeMethod · 0.45

Tested by 1

TestIsInfOrNanMethod · 0.68