ONE - On-device Neural Engine
Loading...
Searching...
No Matches
ForEachDimension< rest > Struct Template Reference

#include <Utils.h>

Static Public Member Functions

template<typename L >
static void unroll (const onert::ir::Shape &shape, onert::ir::Coordinates &coords, L lambda_function)
 

Detailed Description

template<size_t rest>
struct ForEachDimension< rest >

Definition at line 28 of file Utils.h.

Member Function Documentation

◆ unroll()

template<size_t rest>
template<typename L >
static void ForEachDimension< rest >::unroll ( const onert::ir::Shape shape,
onert::ir::Coordinates coords,
lambda_function 
)
inlinestatic

Definition at line 31 of file Utils.h.

33 {
34 if (static_cast<int>(rest) > shape.rank())
35 {
36 ForEachDimension<rest - 1>::unroll(shape, coords, lambda_function);
37 return;
38 }
39
40 const auto axis = shape.rank() - rest;
41 const auto &d = shape.dim(axis);
42
43 for (auto v = 0; v < d; v++)
44 {
45 coords.set(axis, v);
46 ForEachDimension<rest - 1>::unroll(shape, coords, lambda_function);
47 }
48 }
Array< CornerBox > coords
static void unroll(const onert::ir::Shape &shape, onert::ir::Coordinates &coords, L lambda_function)
Definition Utils.h:31

References coords, and ForEachDimension< rest >::unroll().

Referenced by ShapeLoop(), and ForEachDimension< rest >::unroll().


The documentation for this struct was generated from the following file: