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

Function FastBoundsCheck

tensorflow/core/framework/bounds_check.h:30–37  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

28// critical contexts where 0 <= index < limit is almost always true.
29template <typename Ta, typename Tb>
30EIGEN_ALWAYS_INLINE EIGEN_DEVICE_FUNC bool FastBoundsCheck(const Ta index,
31 const Tb limit) {
32 static_assert(std::is_integral<Ta>::value && std::is_integral<Tb>::value,
33 "FastBoundsCheck can only be used on integer types.");
34 typedef typename std::make_unsigned<decltype(index + limit)>::type UIndex;
35 return TF_PREDICT_TRUE(static_cast<UIndex>(index) <
36 static_cast<UIndex>(limit));
37}
38
39namespace internal {
40// Ensure that the compiler cannot elide a copy into a local, for

Callers 15

ComputeMethod · 0.85
CheckShapeMethod · 0.85
TensorShapeToConstantFunction · 0.85
CompileMethod · 0.85
CompileMethod · 0.85
CompileMethod · 0.85
CompileMethod · 0.85
DescribeCycleFunction · 0.85
DescribeCycleFunction · 0.85
ReplaceDimMethod · 0.85
MklLRNOpMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected