15 constexpr
const int MAX_DIMS_NUMBER = 12;
17 enum eDIMS_AXIS : uint8_t {
23 template<
class T,
int N = MAX_DIMS_NUMBER>
26 bool _allocated[N] = {};
36 for (
size_t i = 0; i < len; i++) {
45 for (
const auto val : values) {
52 for (
const auto val : init_list) {
66 return _axises[index];
69 const T &operator[](
size_t index)
const {
70 if (index >= N ||!_allocated[index]) {
73 return _axises[index];
76 T &operator[](
size_t index) {
77 if (index >= N || !_allocated[index]) {
80 return _axises[index];
86 for (
size_t i = 0; i < N; i++) {
87 _allocated[i] = src._allocated[i];
97 if (
this == &src)
return true;
98 if (_length != src.size())
return false;
99 for (
size_t i = 0; i < N; i++)
100 if ((_allocated[i] != src._allocated[i]) ||
101 (_allocated[i] && _axises[i] != src._axises[i]))
return false;
105 size_t size()
const {
109 void insert(
size_t axis,
const T &val) {
111 if (!_allocated[axis]) {
112 _allocated[axis] =
true;
121 void remove(
size_t axis) {
122 if (axis < N && _allocated[axis]) {
123 _allocated[axis] =
false;
129 for (
int i = 0; i != N; i++) {
135 bool exist(
size_t axis)
const {
136 return (axis < N && _allocated[axis]);
#define THROW_IE_EXCEPTION
A macro used to throw the exception with a notable description.
Definition: ie_exception.hpp:22
Definition: ie_argmax_layer.hpp:11
Definition: ie_layers_property.hpp:24
T & at(int index)
allows access up-to capacity size
Definition: ie_layers_property.hpp:62