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

Function Epsilon

tensorflow/compiler/xla/client/lib/constants.cc:44–63  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

42}
43
44XlaOp Epsilon(XlaBuilder* builder, PrimitiveType type) {
45 switch (type) {
46 case F16:
47 return ConstantR0<Eigen::half>(
48 builder,
49 static_cast<Eigen::half>(Eigen::NumTraits<Eigen::half>::epsilon()));
50 case BF16:
51 return ConstantR0<Eigen::bfloat16>(
52 builder, static_cast<Eigen::bfloat16>(
53 Eigen::NumTraits<Eigen::bfloat16>::epsilon()));
54 case F32:
55 return ConstantR0<float>(builder, std::numeric_limits<float>::epsilon());
56 case F64:
57 return ConstantR0<double>(builder,
58 std::numeric_limits<double>::epsilon());
59 default:
60 return builder->ReportError(InvalidArgument(
61 "Invalid type for Epsilon (%s).", PrimitiveType_Name(type)));
62 }
63}
64
65XlaOp MinValue(XlaBuilder* builder, PrimitiveType type) {
66 return ConstantLiteral(builder, LiteralUtil::MinValue(type));

Callers 4

IgammaSeriesFunction · 0.85
IgammacContinuedFractionFunction · 0.85
XLA_TEST_FFunction · 0.85

Calls 3

epsilonFunction · 0.85
InvalidArgumentFunction · 0.85
ReportErrorMethod · 0.45

Tested by 1

XLA_TEST_FFunction · 0.68