From 29b19315e7e1d805e2df8922cc44b36e6e66a61c Mon Sep 17 00:00:00 2001 From: =?utf8?q?=EC=98=A4=ED=98=95=EC=84=9D/=EB=8F=99=EC=9E=91=EC=A0=9C?= =?utf8?q?=EC=96=B4Lab=28SR=29/Staff=20Engineer/=EC=82=BC=EC=84=B1?= =?utf8?q?=EC=A0=84=EC=9E=90?= Date: Thu, 30 Aug 2018 16:02:30 +0900 Subject: [PATCH] [neurun] Move internal/operand to graph/operand (#2520) Move internal/operand to graph/operand Change namespace neurun::internal::operand to neurun::graph::operand Remove internal/operand Signed-off-by: Hyeongseok Oh --- runtimes/neurun/src/backend/cpu/InitializerGenerator.cc | 8 ++++---- runtimes/neurun/src/frontend/model.cc | 10 +++++----- runtimes/neurun/src/graph/Graph.cc | 6 ++---- runtimes/neurun/src/graph/Graph.h | 6 ++---- runtimes/neurun/src/{internal => graph}/operand/Data.h | 10 +++++----- .../neurun/src/{internal => graph}/operand/DataType.h | 10 +++++----- runtimes/neurun/src/graph/operand/IndexSet.h | 2 +- runtimes/neurun/src/{internal => graph}/operand/Object.cc | 4 ++-- runtimes/neurun/src/{internal => graph}/operand/Object.h | 10 +++++----- runtimes/neurun/src/graph/operand/Set.cc | 8 ++++---- runtimes/neurun/src/graph/operand/Set.h | 15 +++++---------- runtimes/neurun/src/{internal => graph}/operand/Shape.cc | 6 +++--- runtimes/neurun/src/{internal => graph}/operand/Shape.h | 10 +++++----- .../neurun/src/{internal => graph}/operand/TypeInfo.cc | 6 +++--- .../neurun/src/{internal => graph}/operand/TypeInfo.h | 12 ++++++------ .../src/kernel/acl_cl/TensorConvertFromCommonLayer.cc | 2 +- .../src/kernel/acl_cl/TensorConvertFromCommonLayer.h | 4 ++-- .../src/kernel/acl_cl/TensorConvertToCommonLayer.cc | 2 +- .../neurun/src/kernel/acl_cl/TensorConvertToCommonLayer.h | 4 ++-- runtimes/neurun/src/kernel/cpu/OperationUtils.cc | 2 +- runtimes/neurun/src/kernel/cpu/OperationUtils.h | 4 ++-- runtimes/neurun/test/graph/operand/Set.cc | 6 +++--- runtimes/neurun/test/graph/operation/Insert.cc | 8 ++++---- runtimes/neurun/test/graph/operation/SetIO.cc | 8 ++++---- runtimes/neurun/test/graph/verifier/Verifier.cc | 4 ++-- 25 files changed, 79 insertions(+), 88 deletions(-) rename runtimes/neurun/src/{internal => graph}/operand/Data.h (84%) rename runtimes/neurun/src/{internal => graph}/operand/DataType.h (57%) rename runtimes/neurun/src/{internal => graph}/operand/Object.cc (96%) rename runtimes/neurun/src/{internal => graph}/operand/Object.h (91%) rename runtimes/neurun/src/{internal => graph}/operand/Shape.cc (93%) rename runtimes/neurun/src/{internal => graph}/operand/Shape.h (78%) rename runtimes/neurun/src/{internal => graph}/operand/TypeInfo.cc (67%) rename runtimes/neurun/src/{internal => graph}/operand/TypeInfo.h (72%) diff --git a/runtimes/neurun/src/backend/cpu/InitializerGenerator.cc b/runtimes/neurun/src/backend/cpu/InitializerGenerator.cc index 3208655..05d2cc1 100644 --- a/runtimes/neurun/src/backend/cpu/InitializerGenerator.cc +++ b/runtimes/neurun/src/backend/cpu/InitializerGenerator.cc @@ -55,7 +55,7 @@ Initializer InitializerGenerator::generateWeight(const graph::operation::FullyCo switch (weight_type) { - case ::neurun::internal::operand::DataType::TENSOR_FLOAT32: + case ::neurun::graph::operand::DataType::TENSOR_FLOAT32: { return [num_output, ifm_shape, weight_base, weight_size](::arm_compute::ITensor &tensor) { const ::nnfw::util::kernel::Shape ker_shape{num_output, ifm_shape.C, ifm_shape.H, @@ -82,7 +82,7 @@ Initializer InitializerGenerator::generateWeight(const graph::operation::FullyCo }; }; } - case ::neurun::internal::operand::DataType::TENSOR_QUANT8_ASYMM: + case ::neurun::graph::operand::DataType::TENSOR_QUANT8_ASYMM: { return [num_output, ifm_shape, weight_base, weight_size](::arm_compute::ITensor &tensor) { const ::nnfw::util::kernel::Shape ker_shape{num_output, ifm_shape.C, ifm_shape.H, @@ -148,7 +148,7 @@ Initializer InitializerGenerator::generateBias(const graph::operation::FullyConn switch (bias_type) { - case ::neurun::internal::operand::DataType::TENSOR_FLOAT32: + case ::neurun::graph::operand::DataType::TENSOR_FLOAT32: { return [bias_base, bias_size](::arm_compute::ITensor &tensor) { for (uint32_t n = 0; n < bias_size; ++n) @@ -164,7 +164,7 @@ Initializer InitializerGenerator::generateBias(const graph::operation::FullyConn } }; } - case ::neurun::internal::operand::DataType::TENSOR_QUANT8_ASYMM: + case ::neurun::graph::operand::DataType::TENSOR_QUANT8_ASYMM: { return [bias_base, bias_size](::arm_compute::ITensor &tensor) { for (uint32_t n = 0; n < bias_size; ++n) diff --git a/runtimes/neurun/src/frontend/model.cc b/runtimes/neurun/src/frontend/model.cc index 588955e..04237dd 100644 --- a/runtimes/neurun/src/frontend/model.cc +++ b/runtimes/neurun/src/frontend/model.cc @@ -78,9 +78,9 @@ int ANeuralNetworksModel_addOperand(ANeuralNetworksModel *model, return ANEURALNETWORKS_BAD_DATA; } - ::neurun::internal::operand::Shape shape(type->dimensionCount); - ::neurun::internal::operand::TypeInfo typeInfo((OperandCode)(type->type), type->scale, - type->zeroPoint); + ::neurun::graph::operand::Shape shape(type->dimensionCount); + ::neurun::graph::operand::TypeInfo typeInfo((OperandCode)(type->type), type->scale, + type->zeroPoint); for (uint32_t axis = 0; axis < type->dimensionCount; ++axis) { @@ -126,7 +126,7 @@ int ANeuralNetworksModel_setOperandValue(ANeuralNetworksModel *model, int32_t in return ANEURALNETWORKS_BAD_DATA; } - using ::neurun::internal::operand::CachedData; + using ::neurun::graph::operand::CachedData; model->deref().setOperandValue( ind, nnfw::make_unique(reinterpret_cast(buffer), length)); @@ -165,7 +165,7 @@ int ANeuralNetworksModel_setOperandValueFromMemory(ANeuralNetworksModel *model, return ANEURALNETWORKS_BAD_DATA; } - using ::neurun::internal::operand::ExternalData; + using ::neurun::graph::operand::ExternalData; model->deref().setOperandValue( ind, nnfw::make_unique( diff --git a/runtimes/neurun/src/graph/Graph.cc b/runtimes/neurun/src/graph/Graph.cc index f0c4084..b0bc637 100644 --- a/runtimes/neurun/src/graph/Graph.cc +++ b/runtimes/neurun/src/graph/Graph.cc @@ -14,8 +14,7 @@ namespace neurun namespace graph { -operand::Index Graph::addOperand(const ::neurun::internal::operand::Shape &shape, - const ::neurun::internal::operand::TypeInfo &type) +operand::Index Graph::addOperand(const operand::Shape &shape, const operand::TypeInfo &type) { assert(_phase == Phase::BUILDING); return _operands.append(shape, type); @@ -71,8 +70,7 @@ operation::Index Graph::insertOperation(const operand::Index &prev_operand_index return _operations.append(std::move(node)); } -void Graph::setOperandValue(const operand::Index &ind, - std::unique_ptr<::neurun::internal::operand::Data> &&data) +void Graph::setOperandValue(const operand::Index &ind, std::unique_ptr &&data) { assert(_phase == Phase::BUILDING); assert(_operands.exist(ind)); diff --git a/runtimes/neurun/src/graph/Graph.h b/runtimes/neurun/src/graph/Graph.h index cbf4e2b..82355df 100644 --- a/runtimes/neurun/src/graph/Graph.h +++ b/runtimes/neurun/src/graph/Graph.h @@ -63,14 +63,12 @@ public: // Graph Building public: - operand::Index addOperand(const ::neurun::internal::operand::Shape &shape, - const ::neurun::internal::operand::TypeInfo &type); + operand::Index addOperand(const operand::Shape &shape, const operand::TypeInfo &type); operation::Index addOperation(std::unique_ptr &&node); operation::Index insertOperation(const operand::Index &prev_operand_index, const operation::Index &next_operation_index, std::unique_ptr &&node); - void setOperandValue(const operand::Index &ind, - std::unique_ptr<::neurun::internal::operand::Data> &&data); + void setOperandValue(const operand::Index &ind, std::unique_ptr &&data); void addInput(const operand::Index &ind); void addOutput(const operand::Index &ind); void finishBuilding(void); diff --git a/runtimes/neurun/src/internal/operand/Data.h b/runtimes/neurun/src/graph/operand/Data.h similarity index 84% rename from runtimes/neurun/src/internal/operand/Data.h rename to runtimes/neurun/src/graph/operand/Data.h index b5465bc..94059de 100644 --- a/runtimes/neurun/src/internal/operand/Data.h +++ b/runtimes/neurun/src/graph/operand/Data.h @@ -1,11 +1,11 @@ -#ifndef __NEURUN_INTERNAL_OPERAND_DATA_H__ -#define __NEURUN_INTERNAL_OPERAND_DATA_H__ +#ifndef __NEURUN_GRAPH_OPERAND_DATA_H__ +#define __NEURUN_GRAPH_OPERAND_DATA_H__ #include namespace neurun { -namespace internal +namespace graph { namespace operand { @@ -56,7 +56,7 @@ private: }; } // namespace operand -} // namespace internal +} // namespace graph } // namespace neurun -#endif // __NEURUN_INTERNAL_OPERAND_DATA_H__ +#endif // __NEURUN_GRAPH_OPERAND_DATA_H__ diff --git a/runtimes/neurun/src/internal/operand/DataType.h b/runtimes/neurun/src/graph/operand/DataType.h similarity index 57% rename from runtimes/neurun/src/internal/operand/DataType.h rename to runtimes/neurun/src/graph/operand/DataType.h index cc23d7f..3a48355 100644 --- a/runtimes/neurun/src/internal/operand/DataType.h +++ b/runtimes/neurun/src/graph/operand/DataType.h @@ -1,9 +1,9 @@ -#ifndef __NEURUN_INTERNAL_OPERAND_DATATYPE_H__ -#define __NEURUN_INTERNAL_OPERAND_DATATYPE_H__ +#ifndef __NEURUN_GRAPH_OPERAND_DATATYPE_H__ +#define __NEURUN_GRAPH_OPERAND_DATATYPE_H__ namespace neurun { -namespace internal +namespace graph { namespace operand { @@ -21,7 +21,7 @@ enum class DataType }; } // namespace operand -} // namespace internal +} // namespace graph } // namespace neurun -#endif // __NEURUN_INTERNAL_OPERAND_DATA_H__ +#endif // __NEURUN_GRAPH_OPERAND_DATATYPE_H__ diff --git a/runtimes/neurun/src/graph/operand/IndexSet.h b/runtimes/neurun/src/graph/operand/IndexSet.h index 6080cf0..077e70b 100644 --- a/runtimes/neurun/src/graph/operand/IndexSet.h +++ b/runtimes/neurun/src/graph/operand/IndexSet.h @@ -4,7 +4,7 @@ #include #include -#include "graph/operand/Index.h" +#include "Index.h" namespace neurun { diff --git a/runtimes/neurun/src/internal/operand/Object.cc b/runtimes/neurun/src/graph/operand/Object.cc similarity index 96% rename from runtimes/neurun/src/internal/operand/Object.cc rename to runtimes/neurun/src/graph/operand/Object.cc index bbb9e7c..cc054a7 100644 --- a/runtimes/neurun/src/internal/operand/Object.cc +++ b/runtimes/neurun/src/graph/operand/Object.cc @@ -2,7 +2,7 @@ namespace neurun { -namespace internal +namespace graph { namespace operand { @@ -58,5 +58,5 @@ bool Object::setUsage(const OperandUsage usage) } } // namespace operand -} // namespace internal +} // namespace graph } // namespace neurun diff --git a/runtimes/neurun/src/internal/operand/Object.h b/runtimes/neurun/src/graph/operand/Object.h similarity index 91% rename from runtimes/neurun/src/internal/operand/Object.h rename to runtimes/neurun/src/graph/operand/Object.h index eaaa987..fc5bd01 100644 --- a/runtimes/neurun/src/internal/operand/Object.h +++ b/runtimes/neurun/src/graph/operand/Object.h @@ -1,5 +1,5 @@ -#ifndef __NEURUN_INTERNAL_OPERAND_OBJECT_H__ -#define __NEURUN_INTERNAL_OPERAND_OBJECT_H__ +#ifndef __NEURUN_GRAPH_OPERAND_OBJECT_H__ +#define __NEURUN_GRAPH_OPERAND_OBJECT_H__ #include #include @@ -12,7 +12,7 @@ namespace neurun { -namespace internal +namespace graph { namespace operand { @@ -76,7 +76,7 @@ private: }; } // namespace operand -} // namespace internal +} // namespace graph } // namespace neurun -#endif // __NEURUN_INTERNAL_OPERAND_OBJECT_H__ +#endif // __NEURUN_GRAPH_OPERAND_OBJECT_H__ diff --git a/runtimes/neurun/src/graph/operand/Set.cc b/runtimes/neurun/src/graph/operand/Set.cc index 61b4953..0e107b9 100644 --- a/runtimes/neurun/src/graph/operand/Set.cc +++ b/runtimes/neurun/src/graph/operand/Set.cc @@ -16,18 +16,18 @@ const Index Set::generateIndex() return Index{_index_count++}; } -Index Set::append(const internal::Shape &shape, const internal::TypeInfo &type) +Index Set::append(const Shape &shape, const TypeInfo &type) { auto index = generateIndex(); - _objects[index.asInt()] = nnfw::make_unique(shape, type); + _objects[index.asInt()] = nnfw::make_unique(shape, type); return index; } -const internal::Object &Set::at(const Index &index) const { return *(_objects.at(index.asInt())); } +const Object &Set::at(const Index &index) const { return *(_objects.at(index.asInt())); } -internal::Object &Set::at(const Index &index) { return *(_objects.at(index.asInt())); } +Object &Set::at(const Index &index) { return *(_objects.at(index.asInt())); } bool Set::exist(const Index &index) const { return index.asInt() < _objects.size(); } diff --git a/runtimes/neurun/src/graph/operand/Set.h b/runtimes/neurun/src/graph/operand/Set.h index 0a6ff76..f618a17 100644 --- a/runtimes/neurun/src/graph/operand/Set.h +++ b/runtimes/neurun/src/graph/operand/Set.h @@ -4,7 +4,7 @@ #include #include -#include "internal/operand/Object.h" +#include "Object.h" #include "Index.h" namespace neurun @@ -14,29 +14,24 @@ namespace graph namespace operand { -namespace -{ -namespace internal = ::neurun::internal::operand; -} - class Set { public: Set() : _index_count(0) {} public: - Index append(const internal::Shape &, const internal::TypeInfo &); + Index append(const Shape &, const TypeInfo &); public: - const internal::Object &at(const Index &) const; - internal::Object &at(const Index &); + const Object &at(const Index &) const; + Object &at(const Index &); bool exist(const Index &) const; private: const Index generateIndex(); private: - std::map> _objects; + std::map> _objects; uint32_t _index_count; }; diff --git a/runtimes/neurun/src/internal/operand/Shape.cc b/runtimes/neurun/src/graph/operand/Shape.cc similarity index 93% rename from runtimes/neurun/src/internal/operand/Shape.cc rename to runtimes/neurun/src/graph/operand/Shape.cc index 17e204f..381bce1 100644 --- a/runtimes/neurun/src/internal/operand/Shape.cc +++ b/runtimes/neurun/src/graph/operand/Shape.cc @@ -1,10 +1,10 @@ #include -#include "internal/operand/Shape.h" +#include "Shape.h" namespace neurun { -namespace internal +namespace graph { namespace operand { @@ -53,5 +53,5 @@ nnfw::util::kernel::Shape Shape::asKernel(void) const } } // namespace operand -} // namespace internal +} // namespace graph } // namespace neurun diff --git a/runtimes/neurun/src/internal/operand/Shape.h b/runtimes/neurun/src/graph/operand/Shape.h similarity index 78% rename from runtimes/neurun/src/internal/operand/Shape.h rename to runtimes/neurun/src/graph/operand/Shape.h index 910836f..f2e89e1 100644 --- a/runtimes/neurun/src/internal/operand/Shape.h +++ b/runtimes/neurun/src/graph/operand/Shape.h @@ -1,6 +1,6 @@ -#ifndef __NEURUN_INTERNAL_OPERAND_SHAPE_H__ -#define __NEURUN_INTERNAL_OPERAND_SHAPE_H__ +#ifndef __NEURUN_GRAPH_OPERAND_SHAPE_H__ +#define __NEURUN_GRAPH_OPERAND_SHAPE_H__ #include #include @@ -10,7 +10,7 @@ namespace neurun { -namespace internal +namespace graph { namespace operand { @@ -38,7 +38,7 @@ private: }; } // namespace operand -} // namespace internal +} // namespace graph } // namespace neurun -#endif // __NEURUN_INTERNAL_OPERAND_SHAPE_H__ +#endif // __NEURUN_GRAPH_OPERAND_SHAPE_H__ diff --git a/runtimes/neurun/src/internal/operand/TypeInfo.cc b/runtimes/neurun/src/graph/operand/TypeInfo.cc similarity index 67% rename from runtimes/neurun/src/internal/operand/TypeInfo.cc rename to runtimes/neurun/src/graph/operand/TypeInfo.cc index d727a52..500e9be 100644 --- a/runtimes/neurun/src/internal/operand/TypeInfo.cc +++ b/runtimes/neurun/src/graph/operand/TypeInfo.cc @@ -2,18 +2,18 @@ namespace neurun { -namespace internal +namespace graph { namespace operand { DataType TypeInfo::typeFromOperandCode(OperandCode type) { - // Now neurun::internal::operand::DataType share same enum value with OperandCode + // Now neurun::graph::operand::DataType share same enum value with OperandCode // in NeuralNetworks.h. return static_cast(static_cast(type)); } } // namespace operand -} // namespace internal +} // namespace graph } // namespace neurun diff --git a/runtimes/neurun/src/internal/operand/TypeInfo.h b/runtimes/neurun/src/graph/operand/TypeInfo.h similarity index 72% rename from runtimes/neurun/src/internal/operand/TypeInfo.h rename to runtimes/neurun/src/graph/operand/TypeInfo.h index a274751..7ee1a4e 100644 --- a/runtimes/neurun/src/internal/operand/TypeInfo.h +++ b/runtimes/neurun/src/graph/operand/TypeInfo.h @@ -1,5 +1,5 @@ -#ifndef __NEURUN_INTERNAL_OPERAND_TYPEINFO_H__ -#define __NEURUN_INTERNAL_OPERAND_TYPEINFO_H__ +#ifndef __NEURUN_GRAPH_OPERAND_TYPEINFO_H__ +#define __NEURUN_GRAPH_OPERAND_TYPEINFO_H__ #include @@ -9,7 +9,7 @@ namespace neurun { -namespace internal +namespace graph { namespace operand { @@ -29,7 +29,7 @@ public: int32_t offset() const { return _offset; } private: - // Now neurun::internal::operand::DataType share same enum value with OperandCode + // Now neurun::graph::operand::DataType share same enum value with OperandCode // in NeuralNetworks.h. // If we don't share same value, we must fix this mapping function. DataType typeFromOperandCode(OperandCode type); @@ -40,7 +40,7 @@ private: int32_t _offset; }; } // namespace operand -} // namespace internal +} // namespace graph } // namespace neurun -#endif // __NEURUN_INTERNAL_OPERAND_TYPEINFO_H__ +#endif // __NEURUN_GRAPH_OPERAND_TYPEINFO_H__ diff --git a/runtimes/neurun/src/kernel/acl_cl/TensorConvertFromCommonLayer.cc b/runtimes/neurun/src/kernel/acl_cl/TensorConvertFromCommonLayer.cc index 3ec1e87..fa1d775 100644 --- a/runtimes/neurun/src/kernel/acl_cl/TensorConvertFromCommonLayer.cc +++ b/runtimes/neurun/src/kernel/acl_cl/TensorConvertFromCommonLayer.cc @@ -78,7 +78,7 @@ bool TensorConvertFromCommonLayer::convert() void TensorConvertFromCommonLayer::configure(::internal::common::Tensor *inputTensor, ::arm_compute::ICLTensor *outputTensor, - const ::neurun::internal::operand::Shape &tensorShape) + const ::neurun::graph::operand::Shape &tensorShape) { _inputTensor = inputTensor; _outputTensor = outputTensor; diff --git a/runtimes/neurun/src/kernel/acl_cl/TensorConvertFromCommonLayer.h b/runtimes/neurun/src/kernel/acl_cl/TensorConvertFromCommonLayer.h index 7537891..bd031a1 100644 --- a/runtimes/neurun/src/kernel/acl_cl/TensorConvertFromCommonLayer.h +++ b/runtimes/neurun/src/kernel/acl_cl/TensorConvertFromCommonLayer.h @@ -47,7 +47,7 @@ public: bool convert(); void configure(::internal::common::Tensor *inputTensor, ::arm_compute::ICLTensor *outputTensor, - const ::neurun::internal::operand::Shape &tensorShape); + const ::neurun::graph::operand::Shape &tensorShape); void run(); @@ -55,7 +55,7 @@ private: ::internal::common::Tensor *_inputTensor; ::arm_compute::ICLTensor *_outputTensor; - ::neurun::internal::operand::Shape _tensorShape{1}; + ::neurun::graph::operand::Shape _tensorShape{1}; }; } // namespace acl_cl diff --git a/runtimes/neurun/src/kernel/acl_cl/TensorConvertToCommonLayer.cc b/runtimes/neurun/src/kernel/acl_cl/TensorConvertToCommonLayer.cc index 89d8322..985524b 100644 --- a/runtimes/neurun/src/kernel/acl_cl/TensorConvertToCommonLayer.cc +++ b/runtimes/neurun/src/kernel/acl_cl/TensorConvertToCommonLayer.cc @@ -78,7 +78,7 @@ bool TensorConvertToCommonLayer::convert() void TensorConvertToCommonLayer::configure(::arm_compute::ICLTensor *inputTensor, ::internal::common::Tensor *outputTensor, - const ::neurun::internal::operand::Shape &tensorShape) + const ::neurun::graph::operand::Shape &tensorShape) { _inputTensor = inputTensor; _outputTensor = outputTensor; diff --git a/runtimes/neurun/src/kernel/acl_cl/TensorConvertToCommonLayer.h b/runtimes/neurun/src/kernel/acl_cl/TensorConvertToCommonLayer.h index 5544ad3..576f1ee 100644 --- a/runtimes/neurun/src/kernel/acl_cl/TensorConvertToCommonLayer.h +++ b/runtimes/neurun/src/kernel/acl_cl/TensorConvertToCommonLayer.h @@ -47,7 +47,7 @@ public: bool convert(); void configure(::arm_compute::ICLTensor *inputTensor, ::internal::common::Tensor *outputTensor, - const ::neurun::internal::operand::Shape &tensorShape); + const ::neurun::graph::operand::Shape &tensorShape); void run(); @@ -55,7 +55,7 @@ private: ::arm_compute::ICLTensor *_inputTensor; ::internal::common::Tensor *_outputTensor; - ::neurun::internal::operand::Shape _tensorShape{1}; + ::neurun::graph::operand::Shape _tensorShape{1}; }; } // namespace acl_cl diff --git a/runtimes/neurun/src/kernel/cpu/OperationUtils.cc b/runtimes/neurun/src/kernel/cpu/OperationUtils.cc index 3f35abb..3b93003 100644 --- a/runtimes/neurun/src/kernel/cpu/OperationUtils.cc +++ b/runtimes/neurun/src/kernel/cpu/OperationUtils.cc @@ -168,7 +168,7 @@ int32_t CalculateInputRadius(int input_integer_bits, int input_left_shift) return static_cast(std::floor(max_input_rescaled)); } -Shape getShape(const ::neurun::internal::operand::Object &o) +Shape getShape(const ::neurun::graph::operand::Object &o) { Shape shape; diff --git a/runtimes/neurun/src/kernel/cpu/OperationUtils.h b/runtimes/neurun/src/kernel/cpu/OperationUtils.h index 412920e..74d474c 100644 --- a/runtimes/neurun/src/kernel/cpu/OperationUtils.h +++ b/runtimes/neurun/src/kernel/cpu/OperationUtils.h @@ -8,7 +8,7 @@ #include #include "tensorflow/contrib/lite/kernels/internal/types.h" -#include "internal/operand/Object.h" +#include "graph/operand/Object.h" namespace neurun { @@ -85,7 +85,7 @@ void CalculateActivationRangeUint8(int32_t activation, const Shape &outputShape, int32_t CalculateInputRadius(int input_integer_bits, int input_left_shift); -Shape getShape(const ::neurun::internal::operand::Object &o); +Shape getShape(const ::neurun::graph::operand::Object &o); uint32_t sizeOfData(OperandType type, const std::vector &dimensions); diff --git a/runtimes/neurun/test/graph/operand/Set.cc b/runtimes/neurun/test/graph/operand/Set.cc index e263277..1eaf445 100644 --- a/runtimes/neurun/test/graph/operand/Set.cc +++ b/runtimes/neurun/test/graph/operand/Set.cc @@ -6,18 +6,18 @@ TEST(graph_operand_Set, set_test) { neurun::graph::operand::Set set; - ::neurun::internal::operand::Shape shape0{3}; + ::neurun::graph::operand::Shape shape0{3}; shape0.dim(0) = 1; shape0.dim(1) = 2; shape0.dim(2) = 3; - ::neurun::internal::operand::Shape shape1{4}; + ::neurun::graph::operand::Shape shape1{4}; shape1.dim(0) = 10; shape1.dim(1) = 20; shape1.dim(2) = 30; shape1.dim(3) = 40; - ::neurun::internal::operand::TypeInfo type{ANEURALNETWORKS_TENSOR_INT32, 0, 0}; + ::neurun::graph::operand::TypeInfo type{ANEURALNETWORKS_TENSOR_INT32, 0, 0}; set.append(shape0, type); set.append(shape1, type); diff --git a/runtimes/neurun/test/graph/operation/Insert.cc b/runtimes/neurun/test/graph/operation/Insert.cc index 60f5cb6..fba7555 100644 --- a/runtimes/neurun/test/graph/operation/Insert.cc +++ b/runtimes/neurun/test/graph/operation/Insert.cc @@ -47,8 +47,8 @@ TEST(graph_operation_manipulation, operation_insertion) neurun::graph::Graph graph; neurun::graph::verifier::DAGChecker verifier; - neurun::internal::operand::Shape shape{1u}; - neurun::internal::operand::TypeInfo type{ANEURALNETWORKS_TENSOR_INT32, 0, 0}; + neurun::graph::operand::Shape shape{1u}; + neurun::graph::operand::TypeInfo type{ANEURALNETWORKS_TENSOR_INT32, 0, 0}; shape.dim(0) = 3; // Model Input/Output @@ -102,8 +102,8 @@ TEST(graph_operation_manipulation, operation_insertion_multi_input) neurun::graph::Graph graph; neurun::graph::verifier::DAGChecker verifier; - neurun::internal::operand::Shape shape{1u}; - neurun::internal::operand::TypeInfo type{ANEURALNETWORKS_TENSOR_INT32, 0, 0}; + neurun::graph::operand::Shape shape{1u}; + neurun::graph::operand::TypeInfo type{ANEURALNETWORKS_TENSOR_INT32, 0, 0}; shape.dim(0) = 3; // Model Input/Output diff --git a/runtimes/neurun/test/graph/operation/SetIO.cc b/runtimes/neurun/test/graph/operation/SetIO.cc index e7b1a76..1579b01 100644 --- a/runtimes/neurun/test/graph/operation/SetIO.cc +++ b/runtimes/neurun/test/graph/operation/SetIO.cc @@ -17,8 +17,8 @@ TEST(graph_operation_setIO, operation_setIO_conv) { neurun::graph::Graph graph; - neurun::internal::operand::Shape shape{1u}; - neurun::internal::operand::TypeInfo type{ANEURALNETWORKS_TENSOR_INT32, 0, 0}; + neurun::graph::operand::Shape shape{1u}; + neurun::graph::operand::TypeInfo type{ANEURALNETWORKS_TENSOR_INT32, 0, 0}; shape.dim(0) = 3; // Add Conv @@ -42,8 +42,8 @@ TEST(graph_operation_setIO, operation_setIO_concat) { neurun::graph::Graph graph; - neurun::internal::operand::Shape shape{1u}; - neurun::internal::operand::TypeInfo type{ANEURALNETWORKS_TENSOR_INT32, 0, 0}; + neurun::graph::operand::Shape shape{1u}; + neurun::graph::operand::TypeInfo type{ANEURALNETWORKS_TENSOR_INT32, 0, 0}; shape.dim(0) = 3; // Add Concat diff --git a/runtimes/neurun/test/graph/verifier/Verifier.cc b/runtimes/neurun/test/graph/verifier/Verifier.cc index 220ed71..08fa495 100644 --- a/runtimes/neurun/test/graph/verifier/Verifier.cc +++ b/runtimes/neurun/test/graph/verifier/Verifier.cc @@ -23,8 +23,8 @@ TEST(Verifier, dag_checker) neurun::graph::Graph graph; neurun::graph::verifier::DAGChecker verifier; - ::neurun::internal::operand::Shape shape{1u}; - ::neurun::internal::operand::TypeInfo type{ANEURALNETWORKS_TENSOR_INT32, 0, 0}; + ::neurun::graph::operand::Shape shape{1u}; + ::neurun::graph::operand::TypeInfo type{ANEURALNETWORKS_TENSOR_INT32, 0, 0}; shape.dim(0) = 3; auto operand1 = graph.addOperand(shape, type); -- 2.7.4