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

Function SubscriptToIndex

tensorflow/lite/kernels/internal/common.h:507–515  ·  view source on GitHub ↗

DO NOT USE THIS FUNCTION FOR NEW FUNCTIONALITY BEYOND IMPLEMENTING BROADCASTING. Same as Offset(), except takes as NdArrayDesc instead of Dims .

Source from the content-addressed store, hash-verified

505//
506// Same as Offset(), except takes as NdArrayDesc<N> instead of Dims<N>.
507inline int SubscriptToIndex(const NdArrayDesc<4>& desc, int i0, int i1, int i2,
508 int i3) {
509 TFLITE_DCHECK(i0 >= 0 && i0 < desc.extents[0]);
510 TFLITE_DCHECK(i1 >= 0 && i1 < desc.extents[1]);
511 TFLITE_DCHECK(i2 >= 0 && i2 < desc.extents[2]);
512 TFLITE_DCHECK(i3 >= 0 && i3 < desc.extents[3]);
513 return i0 * desc.strides[0] + i1 * desc.strides[1] + i2 * desc.strides[2] +
514 i3 * desc.strides[3];
515}
516
517// Given the dimensions of the operands for an element-wise binary broadcast,
518// adjusts them so that they can be directly iterated over with simple loops.

Callers 15

BroadcastDiv4DSlowFunction · 0.85
BroadcastMul4DSlowFunction · 0.85
BroadcastDiv4DSlowFunction · 0.85
BroadcastSub4DSlowFunction · 0.85
SubFunction · 0.85
BroadcastPow4DSlowFunction · 0.85
BroadcastAdd4DSlowFunction · 0.85
BroadcastPrelu4DSlowFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected