From 187f316cf7e7fd2b7f13fcf471a6fd4e1020248a Mon Sep 17 00:00:00 2001 From: =?utf8?q?=EC=9E=A5=EC=A7=80=EC=84=AD/=EB=8F=99=EC=9E=91=EC=A0=9C?= =?utf8?q?=EC=96=B4Lab=28SR=29/Engineer/=EC=82=BC=EC=84=B1=EC=A0=84?= =?utf8?q?=EC=9E=90?= Date: Mon, 15 Oct 2018 18:41:30 +0900 Subject: [PATCH] Add a function that converts the coordinates of the runtime into the coordinates of ACL. (#3117) This commit adds a function that converts the coordinates of the runtime into the coordinates of ACL. Signed-off-by: jiseob.jang --- runtimes/pure_arm_compute/src/internal/arm_compute/Cast.cc | 12 ++++++++++++ runtimes/pure_arm_compute/src/internal/arm_compute/Cast.h | 3 +++ 2 files changed, 15 insertions(+) diff --git a/runtimes/pure_arm_compute/src/internal/arm_compute/Cast.cc b/runtimes/pure_arm_compute/src/internal/arm_compute/Cast.cc index d051ee1..d33de2f 100644 --- a/runtimes/pure_arm_compute/src/internal/arm_compute/Cast.cc +++ b/runtimes/pure_arm_compute/src/internal/arm_compute/Cast.cc @@ -32,6 +32,18 @@ return res; } +::arm_compute::Coordinates asARMComputeCoordinates(const ::arm_compute::Coordinates &runtime_coord, + const ::arm_compute::Coordinates &axises) +{ + ::arm_compute::Coordinates id{}; + assert(runtime_coord.num_dimensions() == axises.num_dimensions()); + for (size_t i = 0; i < runtime_coord.num_dimensions(); ++i) + { + id.set(axises[i], runtime_coord[i]); + } + return id; +} + ::arm_compute::TensorShape asTensorShape(const internal::tflite::operand::Shape &shape, bool apply_dim_correction) { diff --git a/runtimes/pure_arm_compute/src/internal/arm_compute/Cast.h b/runtimes/pure_arm_compute/src/internal/arm_compute/Cast.h index b7cb2de..7cdcb0c 100644 --- a/runtimes/pure_arm_compute/src/internal/arm_compute/Cast.h +++ b/runtimes/pure_arm_compute/src/internal/arm_compute/Cast.h @@ -28,6 +28,9 @@ ::arm_compute::Coordinates getARMComputeAxises(uint32_t rank); +::arm_compute::Coordinates asARMComputeCoordinates(const ::arm_compute::Coordinates &runtime_coord, + const ::arm_compute::Coordinates &axises); + ::arm_compute::TensorShape asTensorShape(const internal::tflite::operand::Shape &shape, bool apply_dim_correction = true); -- 2.7.4