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

Function Offset

tensorflow/lite/experimental/ruy/internal_matrix.h:276–287  ·  view source on GitHub ↗

TODO(b/130417400) add a unit test

Source from the content-addressed store, hash-verified

274
275// TODO(b/130417400) add a unit test
276inline int Offset(const Layout& layout, int row, int col) {
277 // TODO(benoitjacob) - should check this but this make the _slow tests take
278 // 5x longer. Find a mitigation like in Eigen with an 'internal' variant
279 // bypassing the check?
280 // RUY_DCHECK_GE(row, 0);
281 // RUY_DCHECK_GE(col, 0);
282 // RUY_DCHECK_LT(row, layout.rows);
283 // RUY_DCHECK_LT(col, layout.cols);
284 int row_stride = layout.order == Order::kColMajor ? 1 : layout.stride;
285 int col_stride = layout.order == Order::kRowMajor ? 1 : layout.stride;
286 return row * row_stride + col * col_stride;
287}
288
289// TODO(b/130417400) add a unit test
290inline int Offset(const PackedLayout& layout, int row, int col) {

Callers 3

ElementPtrFunction · 0.70

Calls 1

is_potFunction · 0.85

Tested by

no test coverage detected