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

Function GetSize

tensorflow/lite/kernels/range.cc:35–45  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

33
34template <typename T>
35TfLiteStatus GetSize(TfLiteContext* context, T start, T limit, T delta,
36 int* size) {
37 TF_LITE_ENSURE(context, !std::equal_to<T>()(delta, 0));
38 TF_LITE_ENSURE(context,
39 (start > limit && delta < 0) || (start < limit && delta > 0));
40 *size =
41 (std::is_integral<T>::value
42 ? ((std::abs(limit - start) + std::abs(delta) - 1) / std::abs(delta))
43 : std::ceil(std::abs((limit - start) / delta)));
44 return kTfLiteOk;
45}
46
47TfLiteStatus ResizeOutput(TfLiteContext* context, const TfLiteTensor* start,
48 const TfLiteTensor* limit, const TfLiteTensor* delta,

Callers 1

ResizeOutputFunction · 0.85

Calls 2

ceilClass · 0.85
absFunction · 0.50

Tested by

no test coverage detected