| 97 | } |
| 98 | |
| 99 | XlaOp 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 | |
| 110 | XlaOp IsNegInf(XlaOp operand) { |
| 111 | auto& b = *operand.builder(); |