[neurun] Fix Reshape operation (#2516)
author이한종/동작제어Lab(SR)/Engineer/삼성전자 <hanjoung.lee@samsung.com>
Wed, 29 Aug 2018 07:54:03 +0000 (16:54 +0900)
committer오형석/동작제어Lab(SR)/Staff Engineer/삼성전자 <hseok82.oh@samsung.com>
Wed, 29 Aug 2018 07:54:03 +0000 (16:54 +0900)
shape_index is a tensor paramenter so it should be one of the inputs.

Signed-off-by: Hanjoung Lee <hanjoung.lee@samsung.com>
runtimes/neurun/src/codegen/Dumper.cc
runtimes/neurun/src/graph/operation/Reshape.cc
runtimes/neurun/src/graph/operation/Reshape.h

index d130bd8..daf1b27 100644 (file)
@@ -59,7 +59,7 @@ void Dumper::visit(const Reshape::Node &node)
 {
   VERBOSE(LIR) << "* Reshape" << std::endl;
   VERBOSE(LIR) << "  - Inputs : IFM(" << node.getInputs().at(0).value() << ") Shape("
-               << node.param().shape_index << ")" << std::endl;
+               << node.getInputs().at(1).value() << ")" << std::endl;
   VERBOSE(LIR) << "  - Output : OFM(" << node.getOutputs().at(0).value() << ")" << std::endl;
 }
 
index 536a323..894bdb5 100644 (file)
@@ -25,15 +25,13 @@ Node::Node(const graph::operation::Node::InitParam &init_param)
   //  1 -> A 1-D tensor of type ANEURALNETWORKS_TENSOR_INT32, defining the shape of the output
   //  tensor
 
-  setInputs({init_param.inputs[0]});
+  setInputs({init_param.inputs[0], init_param.inputs[1]});
   setOutputs({init_param.outputs[0]});
-
-  _param.shape_index = init_param.inputs[1];
 }
 
 void Node::setInputs(const operand::IndexSet &indexes)
 {
-  assert(indexes.size() == 1);
+  assert(indexes.size() == 2);
 
   graph::operation::Node::setInputs(indexes);
 }
index 4587c16..05d0efa 100644 (file)
@@ -15,11 +15,6 @@ namespace operation
 namespace Reshape
 {
 
-struct Param
-{
-  int32_t shape_index;
-};
-
 class Node : public graph::operation::Node
 {
 public:
@@ -31,12 +26,6 @@ public:
 public:
   virtual void setInputs(const operand::IndexSet &indexes) override;
   virtual void setOutputs(const operand::IndexSet &indexes) override;
-
-public:
-  const Param &param() const { return _param; }
-
-private:
-  Param _param;
 };
 
 } // namespace Reshape