From 0b8b9c1fb22d53f6b79cc6c55a76687aa27e805b 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: Tue, 5 Jun 2018 19:59:14 +0900 Subject: [PATCH] Fix push-cross-build failure (#1578) It is an error caused by timing. A parameter of asTensorInfo() has been changed arm_compute::DataType to int32_t. Signed-off-by: jiseob.jang --- runtimes/pure_arm_compute/src/compilation.cc | 10 +++++----- runtimes/pure_arm_compute/src/execution.cc | 11 ++++++++--- 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/runtimes/pure_arm_compute/src/compilation.cc b/runtimes/pure_arm_compute/src/compilation.cc index b950dbc..e2119fc 100644 --- a/runtimes/pure_arm_compute/src/compilation.cc +++ b/runtimes/pure_arm_compute/src/compilation.cc @@ -1221,12 +1221,12 @@ void Planner::visit(const ::internal::tflite::op::StridedSlice::Node &node) _ctx.at(inputData_index).type())); _builder.addShapeConstr(startData_index, asTensorInfo(_ctx.at(startData_index).shape().asVector(), - ::arm_compute::DataType::S32)); + _ctx.at(startData_index).type())); _builder.addShapeConstr(endData_index, asTensorInfo(_ctx.at(endData_index).shape().asVector(), - ::arm_compute::DataType::S32)); - _builder.addShapeConstr( - stridesData_index, - asTensorInfo(_ctx.at(stridesData_index).shape().asVector(), ::arm_compute::DataType::S32)); + _ctx.at(endData_index).type())); + _builder.addShapeConstr(stridesData_index, + asTensorInfo(_ctx.at(stridesData_index).shape().asVector(), + _ctx.at(stridesData_index).type())); struct Param { diff --git a/runtimes/pure_arm_compute/src/execution.cc b/runtimes/pure_arm_compute/src/execution.cc index 239e1e1..a9a046d 100644 --- a/runtimes/pure_arm_compute/src/execution.cc +++ b/runtimes/pure_arm_compute/src/execution.cc @@ -151,12 +151,17 @@ int ANeuralNetworksExecution_setInput(ANeuralNetworksExecution *execution, int32 // NOTE The current implemenation assumes that every input is a feature map. // TODO Remove this assumption const auto operand_index = execution->plan().model().inputs.at(index); + int32_t input_type = operands.at(operand_index).type(); + if (type != nullptr) + { + input_type = type->type; + } if (operands.at(operand_index).shape().rank() == 1) { const auto len = operands.at(operand_index).shape().dim(0); - asVectorSource(execution, type->type, index, len, buffer, length); + asVectorSource(execution, input_type, index, len, buffer, length); } else if (operands.at(operand_index).shape().rank() == 2) { @@ -165,13 +170,13 @@ int ANeuralNetworksExecution_setInput(ANeuralNetworksExecution *execution, int32 const auto len = operands.at(operand_index).shape().dim(0) * operands.at(operand_index).shape().dim(1); - asVectorSource(execution, type->type, index, len, buffer, length); + asVectorSource(execution, input_type, index, len, buffer, length); } else if (operands.at(operand_index).shape().rank() == 4) { const auto &operand_shape = operands.at(operand_index).shape().asFeature(); - asFeatureSource(execution, type->type, index, operand_shape, buffer, length); + asFeatureSource(execution, input_type, index, operand_shape, buffer, length); } else { -- 2.7.4