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

Function EnsureOperandIsRealFp

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

TODO(jlebar): Use this function in more places in this file to restrict the domain of other functions.

Source from the content-addressed store, hash-verified

85// TODO(jlebar): Use this function in more places in this file to restrict the
86// domain of other functions.
87static Status EnsureOperandIsRealFp(absl::string_view op_name, XlaOp operand) {
88 auto& b = *operand.builder();
89 TF_ASSIGN_OR_RETURN(auto shape, b.GetShape(operand));
90 auto elem_ty = shape.element_type();
91 if (!primitive_util::IsFloatingPointType(elem_ty)) {
92 return InvalidArgument(
93 "Operands to %s must be real-valued floating-point, but got %s",
94 op_name, PrimitiveType_Name(elem_ty));
95 }
96 return Status::OK();
97}
98
99XlaOp IsPosInf(XlaOp operand) {
100 auto& b = *operand.builder();

Callers 15

IsPosInfFunction · 0.85
IsNegInfFunction · 0.85
IsInfFunction · 0.85
IsNanFunction · 0.85
IsNegZeroFunction · 0.85
ErfcFunction · 0.85
ErfFunction · 0.85
ErfInvFunction · 0.85
LgammaFunction · 0.85
DigammaFunction · 0.85
IgammaFunction · 0.85
IgammaGradAFunction · 0.85

Calls 4

IsFloatingPointTypeFunction · 0.85
InvalidArgumentFunction · 0.85
builderMethod · 0.45
element_typeMethod · 0.45

Tested by

no test coverage detected