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

Function GetPowerBucket

tensorflow/core/kernels/tensor_flag_utils.cc:152–160  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

150
151template <typename Tindices>
152Tindices GetPowerBucket(const Tindices value, const Tindices bucket_size) {
153 if (bucket_size == 1) {
154 return 1;
155 }
156 return std::pow(bucket_size, std::floor(std::log(bucket_size * (value - 1)) /
157 std::log(bucket_size)) -
158 1) +
159 1;
160}
161
162#define REGISTER_SPARSE_UTIL_FUNCTIONS(TypeIndex) \
163 template float FindConfigValueForKey<float, TypeIndex>( \

Callers 1

TESTFunction · 0.85

Calls 3

floorClass · 0.85
powClass · 0.70
logClass · 0.70

Tested by 1

TESTFunction · 0.68