summaryrefslogtreecommitdiff
path: root/runtimes/pure_arm_compute/src/internal/Model.cc
diff options
context:
space:
mode:
Diffstat (limited to 'runtimes/pure_arm_compute/src/internal/Model.cc')
-rw-r--r--runtimes/pure_arm_compute/src/internal/Model.cc25
1 files changed, 14 insertions, 11 deletions
diff --git a/runtimes/pure_arm_compute/src/internal/Model.cc b/runtimes/pure_arm_compute/src/internal/Model.cc
index 3a31f9911..03753fea2 100644
--- a/runtimes/pure_arm_compute/src/internal/Model.cc
+++ b/runtimes/pure_arm_compute/src/internal/Model.cc
@@ -16,8 +16,6 @@
#include "internal/Model.h"
-#include <cassert>
-
namespace internal
{
namespace tflite
@@ -25,7 +23,7 @@ namespace tflite
namespace operand
{
-Shape::Shape(uint32_t rank) : nnfw::util::tensor::Shape(rank)
+Shape::Shape(uint32_t rank) : nnfw::misc::tensor::Shape(rank)
{
// DO NOTHING
}
@@ -37,17 +35,17 @@ int32_t Shape::asVector(void) const
return dim(0);
}
-nnfw::util::matrix::Shape Shape::asMatrix(void) const
+nnfw::misc::matrix::Shape Shape::asMatrix(void) const
{
assert(rank() == 2);
const auto height = dim(0);
const auto width = dim(1);
- return nnfw::util::matrix::Shape(height, width);
+ return nnfw::misc::matrix::Shape(height, width);
}
-nnfw::util::feature::Shape Shape::asFeature(void) const
+nnfw::misc::feature::Shape Shape::asFeature(void) const
{
assert(rank() == 4);
@@ -62,15 +60,15 @@ nnfw::util::feature::Shape Shape::asFeature(void) const
const auto height = dim(1);
const auto width = dim(2);
- return nnfw::util::feature::Shape(batch, depth, height, width);
+ return nnfw::misc::feature::Shape(batch, depth, height, width);
}
-nnfw::util::tensor::Shape Shape::asTensor(void) const
+nnfw::misc::tensor::Shape Shape::asTensor(void) const
{
- return nnfw::util::tensor::Shape(*this); // this shape represents shape of NNAPI
+ return nnfw::misc::tensor::Shape(*this); // this shape represents shape of NNAPI
}
-nnfw::util::kernel::Shape Shape::asKernel(void) const
+nnfw::misc::kernel::Shape Shape::asKernel(void) const
{
assert(rank() == 4);
@@ -84,7 +82,7 @@ nnfw::util::kernel::Shape Shape::asKernel(void) const
const auto height = dim(1);
const auto width = dim(2);
- return nnfw::util::kernel::Shape(count, depth, height, width);
+ return nnfw::misc::kernel::Shape(count, depth, height, width);
}
// Extended dimension is filled with 1.
@@ -120,6 +118,11 @@ const Object &Set::at(const Index &index) const { return *(_objects.at(index.asI
Object &Set::at(const Index &index) { return *(_objects.at(index.asInt())); }
+bool Set::exist(const Index &index) const
+{
+ return index.asInt() >= 0 && index.asInt() < _objects.size();
+}
+
} // namespace operand
} // namespace tflite
} // namespace internal