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

Function IsNegInf

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

Source from the content-addressed store, hash-verified

108}
109
110XlaOp IsNegInf(XlaOp operand) {
111 auto& b = *operand.builder();
112 return b.ReportErrorOrReturn([&]() -> StatusOr<XlaOp> {
113 TF_RETURN_IF_ERROR(EnsureOperandIsRealFp("IsNegInf", operand));
114 TF_ASSIGN_OR_RETURN(auto shape, b.GetShape(operand));
115 // Note that this is only correct for floating-point types. If we wanted it
116 // to be correct for all types, we'd need to Lt(MinFiniteValue).
117 return Eq(operand, MinValue(&b, shape.element_type()));
118 });
119}
120
121XlaOp IsInf(XlaOp operand) {
122 auto& b = *operand.builder();

Callers 1

TestIsInfOrNanMethod · 0.85

Calls 6

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

Tested by 1

TestIsInfOrNanMethod · 0.68