summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author박종현/On-Device Lab(SR)/Staff Engineer/삼성전자 <jh1302.park@samsung.com>2019-09-17 03:29:26 (GMT)
committerGitHub Enterprise <noreply-CODE@samsung.com>2019-09-17 03:29:26 (GMT)
commitd752c054cfe04685e04b2ab4eec31c65b3fed3e4 (patch)
tree406a544fd8c9f708ef4e820f23a359540f2b86a8
parentc565315a98ad6e498732702efb996815f3e95238 (diff)
downloadnnfw-d752c054cfe04685e04b2ab4eec31c65b3fed3e4.zip
nnfw-d752c054cfe04685e04b2ab4eec31c65b3fed3e4.tar.gz
nnfw-d752c054cfe04685e04b2ab4eec31c65b3fed3e4.tar.bz2
[locomotiv] Erase annotated data before execute (#7496)
All the execute method implementations invoke "erase_annot_data" internally. Signed-off-by: Jonghyun Park <jh1302.park@samsung.com>
-rw-r--r--compiler/locomotiv/src/Node/AvgPool2D.cpp1
-rw-r--r--compiler/locomotiv/src/Node/BiasAdd.cpp2
-rw-r--r--compiler/locomotiv/src/Node/BiasEncode.cpp1
-rw-r--r--compiler/locomotiv/src/Node/ConstGen.cpp1
-rw-r--r--compiler/locomotiv/src/Node/Conv2D.cpp1
-rw-r--r--compiler/locomotiv/src/Node/DepthwiseConv2D.cpp1
-rw-r--r--compiler/locomotiv/src/Node/DepthwiseFilterEncode.cpp1
-rw-r--r--compiler/locomotiv/src/Node/FeatureDecode.cpp1
-rw-r--r--compiler/locomotiv/src/Node/FeatureEncode.cpp1
-rw-r--r--compiler/locomotiv/src/Node/FilterEncode.cpp1
-rw-r--r--compiler/locomotiv/src/Node/Forward.cpp1
-rw-r--r--compiler/locomotiv/src/Node/MaxPool2D.cpp1
-rw-r--r--compiler/locomotiv/src/Node/Pull.cpp1
-rw-r--r--compiler/locomotiv/src/Node/Push.cpp1
-rw-r--r--compiler/locomotiv/src/Node/ReLU6.cpp1
-rw-r--r--compiler/locomotiv/src/Node/Reshape.cpp1
-rw-r--r--compiler/locomotiv/src/Node/Softmax.cpp1
-rw-r--r--compiler/locomotiv/src/Node/TensorBroadcast.cpp1
-rw-r--r--compiler/locomotiv/src/Node/TensorConcat.cpp1
-rw-r--r--compiler/locomotiv/src/Node/TransposedConv2D.cpp1
-rw-r--r--compiler/locomotiv/src/NodeExecution.cpp4
21 files changed, 2 insertions, 23 deletions
diff --git a/compiler/locomotiv/src/Node/AvgPool2D.cpp b/compiler/locomotiv/src/Node/AvgPool2D.cpp
index 7dcaed8..ad603ba 100644
--- a/compiler/locomotiv/src/Node/AvgPool2D.cpp
+++ b/compiler/locomotiv/src/Node/AvgPool2D.cpp
@@ -172,7 +172,6 @@ void NodeExecution::execute(loco::AvgPool2D *avgpool2d)
assert(avgpool2d_data != nullptr);
- erase_annot_data(avgpool2d);
annot_data(avgpool2d, std::move(avgpool2d_data));
annot_domain(avgpool2d, loco::Domain::Feature);
}
diff --git a/compiler/locomotiv/src/Node/BiasAdd.cpp b/compiler/locomotiv/src/Node/BiasAdd.cpp
index 8bf7f1b..0724fb7 100644
--- a/compiler/locomotiv/src/Node/BiasAdd.cpp
+++ b/compiler/locomotiv/src/Node/BiasAdd.cpp
@@ -57,7 +57,6 @@ void NodeExecution::execute(loco::BiasAdd<loco::Domain::Tensor> *bias_add)
std::unique_ptr<NodeData> bias_add_data = calc(input_data, bias_data, bias_add->axis());
assert(bias_add_data != nullptr);
- erase_annot_data(bias_add);
annot_data(bias_add, std::move(bias_add_data));
annot_domain(bias_add, annot_domain(bias_add->value()));
}
@@ -75,7 +74,6 @@ void NodeExecution::execute(loco::BiasAdd<loco::Domain::Feature> *bias_add)
std::unique_ptr<NodeData> bias_add_data = calc(input_data, bias_data, 3);
assert(bias_add_data != nullptr);
- erase_annot_data(bias_add);
annot_data(bias_add, std::move(bias_add_data));
annot_domain(bias_add, loco::Domain::Feature);
}
diff --git a/compiler/locomotiv/src/Node/BiasEncode.cpp b/compiler/locomotiv/src/Node/BiasEncode.cpp
index 4df05ce..c2f2b44 100644
--- a/compiler/locomotiv/src/Node/BiasEncode.cpp
+++ b/compiler/locomotiv/src/Node/BiasEncode.cpp
@@ -56,7 +56,6 @@ void NodeExecution::execute(loco::BiasEncode *bias_enc)
}
assert(bias_enc_data != nullptr);
- erase_annot_data(bias_enc);
annot_data(bias_enc, std::move(bias_enc_data));
annot_domain(bias_enc, loco::Domain::Bias);
}
diff --git a/compiler/locomotiv/src/Node/ConstGen.cpp b/compiler/locomotiv/src/Node/ConstGen.cpp
index e62a2d8..0360b9f 100644
--- a/compiler/locomotiv/src/Node/ConstGen.cpp
+++ b/compiler/locomotiv/src/Node/ConstGen.cpp
@@ -109,7 +109,6 @@ void NodeExecution::execute(loco::ConstGen *constgen)
}
assert(data != nullptr);
- erase_annot_data(constgen);
annot_data(constgen, std::move(data));
annot_domain(constgen, loco::Domain::Tensor);
}
diff --git a/compiler/locomotiv/src/Node/Conv2D.cpp b/compiler/locomotiv/src/Node/Conv2D.cpp
index e1c9a8e..2e41855 100644
--- a/compiler/locomotiv/src/Node/Conv2D.cpp
+++ b/compiler/locomotiv/src/Node/Conv2D.cpp
@@ -172,7 +172,6 @@ void NodeExecution::execute(loco::Conv2D *conv2d)
assert(conv2d_result != nullptr);
- erase_annot_data(conv2d);
annot_data(conv2d, std::move(conv2d_result));
annot_domain(conv2d, loco::Domain::Feature);
}
diff --git a/compiler/locomotiv/src/Node/DepthwiseConv2D.cpp b/compiler/locomotiv/src/Node/DepthwiseConv2D.cpp
index c798662..92d5aa1 100644
--- a/compiler/locomotiv/src/Node/DepthwiseConv2D.cpp
+++ b/compiler/locomotiv/src/Node/DepthwiseConv2D.cpp
@@ -178,7 +178,6 @@ void NodeExecution::execute(loco::DepthwiseConv2D *dw_conv2d)
assert(dw_conv2d_result != nullptr);
- erase_annot_data(dw_conv2d);
annot_data(dw_conv2d, std::move(dw_conv2d_result));
annot_domain(dw_conv2d, loco::Domain::Feature);
}
diff --git a/compiler/locomotiv/src/Node/DepthwiseFilterEncode.cpp b/compiler/locomotiv/src/Node/DepthwiseFilterEncode.cpp
index 760dc43..1700490 100644
--- a/compiler/locomotiv/src/Node/DepthwiseFilterEncode.cpp
+++ b/compiler/locomotiv/src/Node/DepthwiseFilterEncode.cpp
@@ -106,7 +106,6 @@ void NodeExecution::execute(loco::DepthwiseFilterEncode *enc)
}
assert(enc_data != nullptr);
- erase_annot_data(enc);
annot_data(enc, std::move(enc_data));
annot_domain(enc, loco::Domain::DepthwiseFilter);
}
diff --git a/compiler/locomotiv/src/Node/FeatureDecode.cpp b/compiler/locomotiv/src/Node/FeatureDecode.cpp
index ee1b808..8a56a56 100644
--- a/compiler/locomotiv/src/Node/FeatureDecode.cpp
+++ b/compiler/locomotiv/src/Node/FeatureDecode.cpp
@@ -105,7 +105,6 @@ void NodeExecution::execute(loco::FeatureDecode *dec)
}
assert(dec_data != nullptr);
- erase_annot_data(dec);
annot_data(dec, std::move(dec_data));
annot_domain(dec, loco::Domain::Tensor);
}
diff --git a/compiler/locomotiv/src/Node/FeatureEncode.cpp b/compiler/locomotiv/src/Node/FeatureEncode.cpp
index 3d7db6c..406de76 100644
--- a/compiler/locomotiv/src/Node/FeatureEncode.cpp
+++ b/compiler/locomotiv/src/Node/FeatureEncode.cpp
@@ -107,7 +107,6 @@ void NodeExecution::execute(loco::FeatureEncode *enc)
}
assert(enc_data != nullptr);
- erase_annot_data(enc);
annot_data(enc, std::move(enc_data));
annot_domain(enc, loco::Domain::Feature);
}
diff --git a/compiler/locomotiv/src/Node/FilterEncode.cpp b/compiler/locomotiv/src/Node/FilterEncode.cpp
index d34a4ff..cd9d708 100644
--- a/compiler/locomotiv/src/Node/FilterEncode.cpp
+++ b/compiler/locomotiv/src/Node/FilterEncode.cpp
@@ -107,7 +107,6 @@ void NodeExecution::execute(loco::FilterEncode *enc)
}
assert(enc_data != nullptr);
- erase_annot_data(enc);
annot_data(enc, std::move(enc_data));
annot_domain(enc, loco::Domain::Filter);
}
diff --git a/compiler/locomotiv/src/Node/Forward.cpp b/compiler/locomotiv/src/Node/Forward.cpp
index e7fe9b8..eb7d44a 100644
--- a/compiler/locomotiv/src/Node/Forward.cpp
+++ b/compiler/locomotiv/src/Node/Forward.cpp
@@ -55,7 +55,6 @@ void NodeExecution::execute(loco::Forward *forward)
}
assert(forward_data != nullptr);
- erase_annot_data(forward);
annot_data(forward, std::move(forward_data));
annot_domain(forward, annot_domain(forward->input()));
}
diff --git a/compiler/locomotiv/src/Node/MaxPool2D.cpp b/compiler/locomotiv/src/Node/MaxPool2D.cpp
index 000e5c8..5d92f89 100644
--- a/compiler/locomotiv/src/Node/MaxPool2D.cpp
+++ b/compiler/locomotiv/src/Node/MaxPool2D.cpp
@@ -160,7 +160,6 @@ void NodeExecution::execute(loco::MaxPool2D *maxpool2d)
assert(maxpool2d_data != nullptr);
- erase_annot_data(maxpool2d);
annot_data(maxpool2d, std::move(maxpool2d_data));
annot_domain(maxpool2d, loco::Domain::Feature);
}
diff --git a/compiler/locomotiv/src/Node/Pull.cpp b/compiler/locomotiv/src/Node/Pull.cpp
index e2015d1..c482d8b 100644
--- a/compiler/locomotiv/src/Node/Pull.cpp
+++ b/compiler/locomotiv/src/Node/Pull.cpp
@@ -65,7 +65,6 @@ void NodeExecution::execute(loco::Pull *pull)
}
assert(pull_data != nullptr);
- erase_annot_data(pull);
annot_data(pull, std::move(pull_data));
annot_domain(pull, loco::Domain::Tensor);
}
diff --git a/compiler/locomotiv/src/Node/Push.cpp b/compiler/locomotiv/src/Node/Push.cpp
index d96650a..fc5808b 100644
--- a/compiler/locomotiv/src/Node/Push.cpp
+++ b/compiler/locomotiv/src/Node/Push.cpp
@@ -54,7 +54,6 @@ void NodeExecution::execute(loco::Push *push)
}
assert(push_data != nullptr);
- erase_annot_data(push);
annot_data(push, std::move(push_data));
annot_domain(push, loco::Domain::Tensor);
}
diff --git a/compiler/locomotiv/src/Node/ReLU6.cpp b/compiler/locomotiv/src/Node/ReLU6.cpp
index efa641f..7da8926 100644
--- a/compiler/locomotiv/src/Node/ReLU6.cpp
+++ b/compiler/locomotiv/src/Node/ReLU6.cpp
@@ -74,7 +74,6 @@ void NodeExecution::execute(loco::ReLU6 *relu6)
}
assert(relu6_data != nullptr);
- erase_annot_data(relu6);
annot_data(relu6, std::move(relu6_data));
annot_domain(relu6, annot_domain(relu6->input()));
}
diff --git a/compiler/locomotiv/src/Node/Reshape.cpp b/compiler/locomotiv/src/Node/Reshape.cpp
index 9380f79..08be4c7 100644
--- a/compiler/locomotiv/src/Node/Reshape.cpp
+++ b/compiler/locomotiv/src/Node/Reshape.cpp
@@ -84,7 +84,6 @@ void NodeExecution::execute(loco::Reshape<loco::ReshapeType::Fixed> *reshape)
}
assert(reshape_data != nullptr);
- erase_annot_data(reshape);
annot_data(reshape, std::move(reshape_data));
annot_domain(reshape, annot_domain(reshape->input()));
}
diff --git a/compiler/locomotiv/src/Node/Softmax.cpp b/compiler/locomotiv/src/Node/Softmax.cpp
index 8d1cc30..352598b 100644
--- a/compiler/locomotiv/src/Node/Softmax.cpp
+++ b/compiler/locomotiv/src/Node/Softmax.cpp
@@ -115,7 +115,6 @@ void NodeExecution::execute(loco::TensorSoftmax *softmax)
}
assert(softmax_data != nullptr);
- erase_annot_data(softmax);
annot_data(softmax, std::move(softmax_data));
annot_domain(softmax, annot_domain(softmax->input()));
}
diff --git a/compiler/locomotiv/src/Node/TensorBroadcast.cpp b/compiler/locomotiv/src/Node/TensorBroadcast.cpp
index 504dcf3..010ca68 100644
--- a/compiler/locomotiv/src/Node/TensorBroadcast.cpp
+++ b/compiler/locomotiv/src/Node/TensorBroadcast.cpp
@@ -99,7 +99,6 @@ void NodeExecution::execute(loco::TensorBroadcast *tensor_broadcast)
}
assert(output_data != nullptr);
- erase_annot_data(tensor_broadcast);
annot_data(tensor_broadcast, std::move(output_data));
annot_domain(tensor_broadcast, loco::Domain::Tensor);
}
diff --git a/compiler/locomotiv/src/Node/TensorConcat.cpp b/compiler/locomotiv/src/Node/TensorConcat.cpp
index 6e0a09a..5097e55 100644
--- a/compiler/locomotiv/src/Node/TensorConcat.cpp
+++ b/compiler/locomotiv/src/Node/TensorConcat.cpp
@@ -106,7 +106,6 @@ void NodeExecution::execute(loco::TensorConcat *tensor_concat)
}
assert(concat_data != nullptr);
- erase_annot_data(tensor_concat);
annot_data(tensor_concat, std::move(concat_data));
annot_domain(tensor_concat, loco::Domain::Tensor);
}
diff --git a/compiler/locomotiv/src/Node/TransposedConv2D.cpp b/compiler/locomotiv/src/Node/TransposedConv2D.cpp
index 07d112a..3ea4f07 100644
--- a/compiler/locomotiv/src/Node/TransposedConv2D.cpp
+++ b/compiler/locomotiv/src/Node/TransposedConv2D.cpp
@@ -182,7 +182,6 @@ void NodeExecution::execute(loco::TransposedConv2D *tr_conv2d)
assert(tr_conv2d_result != nullptr);
- erase_annot_data(tr_conv2d);
annot_data(tr_conv2d, std::move(tr_conv2d_result));
annot_domain(tr_conv2d, loco::Domain::Feature);
}
diff --git a/compiler/locomotiv/src/NodeExecution.cpp b/compiler/locomotiv/src/NodeExecution.cpp
index d88c03f..e532b5a 100644
--- a/compiler/locomotiv/src/NodeExecution.cpp
+++ b/compiler/locomotiv/src/NodeExecution.cpp
@@ -53,6 +53,8 @@ int32_t BinaryFunc::apply(int32_t, int32_t) const
// TODO Use visitor pattern of loco when available
void NodeExecution::run(loco::Node *node)
{
+ erase_annot_data(node);
+
#define NODE(Name) \
if (as<loco::Name>(node)) \
{ \
@@ -106,7 +108,6 @@ void NodeExecution::eltwise_unary(loco::Node *node, const UnaryFunc &f)
}
assert(output_data != nullptr);
- erase_annot_data(output_node);
annot_data(output_node, std::move(output_data));
annot_domain(output_node, output_domain);
}
@@ -150,7 +151,6 @@ void NodeExecution::eltwise_binary(loco::Node *node, const BinaryFunc &f)
}
assert(out_data != nullptr);
- erase_annot_data(out_node);
annot_data(out_node, std::move(out_data));
annot_domain(out_node, annot_domain(lhs_node));
}