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

Function Offset

tensorflow/lite/kernels/internal/types.h:379–387  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

377}
378
379inline int Offset(const RuntimeShape& shape, int i0, int i1, int i2, int i3) {
380 TFLITE_DCHECK_EQ(shape.DimensionsCount(), 4);
381 const int* dims_data = reinterpret_cast<const int*>(shape.DimsDataUpTo4D());
382 TFLITE_DCHECK(i0 >= 0 && i0 < dims_data[0]);
383 TFLITE_DCHECK(i1 >= 0 && i1 < dims_data[1]);
384 TFLITE_DCHECK(i2 >= 0 && i2 < dims_data[2]);
385 TFLITE_DCHECK(i3 >= 0 && i3 < dims_data[3]);
386 return ((i0 * dims_data[1] + i1) * dims_data[2] + i2) * dims_data[3] + i3;
387}
388
389inline int Offset(const Dims<4>& dims, int i0, int i1, int i2, int i3) {
390 TFLITE_DCHECK(i0 >= 0 && i0 < dims.sizes[0]);

Callers 15

PickOutputMultiplierFunction · 0.70
DilatedIm2colFunction · 0.50
MeanImplFunction · 0.50
DepthToSpaceFunction · 0.50
SpaceToDepthFunction · 0.50
BroadcastDiv4DSlowFunction · 0.50
AveragePool16Function · 0.50
AveragePool32Function · 0.50
MaxPoolFunction · 0.50
ResizeBilinearKernel2x2Function · 0.50
ResizeBilinearGenericFunction · 0.50

Calls 2

DimensionsCountMethod · 0.80
DimsDataUpTo4DMethod · 0.80

Tested by 1

PickOutputMultiplierFunction · 0.56