15 constexpr
const int MAX_DIMS_NUMBER = 12;
17 enum eDIMS_AXIS : uint8_t { X_AXIS = 0, Y_AXIS, Z_AXIS };
19 template <
class T,
int N = MAX_DIMS_NUMBER>
22 bool _allocated[N] = {};
32 for (
size_t i = 0; i < len; i++) {
41 for (
const auto val : values) {
48 for (
const auto val : init_list) {
62 return _axises[index];
65 const T& operator[](
size_t index)
const {
66 if (index >= N || !_allocated[index]) {
69 return _axises[index];
72 T& operator[](
size_t index) {
73 if (index >= N || !_allocated[index]) {
76 return _axises[index];
82 for (
size_t i = 0; i < N; i++) {
83 _allocated[i] = src._allocated[i];
93 if (
this == &src)
return true;
94 if (_length != src.size())
return false;
95 for (
size_t i = 0; i < N; i++)
96 if ((_allocated[i] != src._allocated[i]) || (_allocated[i] && _axises[i] != src._axises[i]))
return false;
100 size_t size()
const {
104 void insert(
size_t axis,
const T& val) {
106 if (!_allocated[axis]) {
107 _allocated[axis] =
true;
112 THROW_IE_EXCEPTION <<
"Layer Property insertion at(axis) should be in [0," << N <<
")";
116 void remove(
size_t axis) {
117 if (axis < N && _allocated[axis]) {
118 _allocated[axis] =
false;
124 for (
int i = 0; i != N; i++) {
130 bool exist(
size_t axis)
const {
131 return (axis < N && _allocated[axis]);
#define THROW_IE_EXCEPTION
A macro used to throw the exception with a notable description.
Definition: ie_exception.hpp:24
Inference Engine API.
Definition: ie_argmax_layer.hpp:11
Definition: ie_layers_property.hpp:20
T & at(int index)
allows access up-to capacity size
Definition: ie_layers_property.hpp:58