aboutsummaryrefslogtreecommitdiff
path: root/reference_model/src/subgraph_traverser.cc
diff options
context:
space:
mode:
authorKevin Cheng <kevin.cheng@arm.com>2021-05-12 10:44:49 -0700
committerKevin Cheng <kevin.cheng@arm.com>2021-05-12 14:51:16 -0700
commit14d7f7a2b5d0d85b83d8c84a5456828feb1a0ea1 (patch)
treec0e5eaa7e119d7998f5780a6c90947e875eddf84 /reference_model/src/subgraph_traverser.cc
parentd267dd9418374d49ac1e1a1a9c9b1d30b5733ee9 (diff)
downloadreference_model-14d7f7a2b5d0d85b83d8c84a5456828feb1a0ea1.tar.gz
Update to v0.22.0
- remove identityN and placeholder - add div - update serialization_lib hash - update apply_scale_16() assertion - regenerate examples/ due to serialization_lib change Change-Id: I7183d92bec33697c65adfc07cb8eb89c6882675a
Diffstat (limited to 'reference_model/src/subgraph_traverser.cc')
-rw-r--r--reference_model/src/subgraph_traverser.cc29
1 files changed, 5 insertions, 24 deletions
diff --git a/reference_model/src/subgraph_traverser.cc b/reference_model/src/subgraph_traverser.cc
index 5096ffa..1995b5c 100644
--- a/reference_model/src/subgraph_traverser.cc
+++ b/reference_model/src/subgraph_traverser.cc
@@ -499,7 +499,6 @@ int SubgraphTraverser::linkTensorsAndNodes()
// For each node, read this list, link up the tensors with their inputs/outputs
for (GraphNode* currNode : nodes)
{
-
// Link inputs/consuming nodes
for (std::string& name : currNode->getInputNames())
{
@@ -566,36 +565,18 @@ int SubgraphTraverser::validateGraph()
for (TosaReference::Tensor* currTensor : tensors)
{
- if (!currTensor->getProducer() && currTensor->getConsumers().empty())
- {
- WARNING("Graph inconsistency: TosaReference::Tensor %s has no producers or consumers\n",
- currTensor->getName().c_str());
- return 1;
- }
-
- if (currTensor->getIsSubgraphInput())
+ // It's okay for block input tensor not being consumed by operators.
+ // This is common in control flow op execution.
+ if (!currTensor->getIsSubgraphInput())
{
- if (currTensor->getProducer() && currTensor->getProducer()->getOp() != Op_PLACEHOLDER)
+ if (!currTensor->getProducer() && currTensor->getConsumers().empty())
{
- WARNING("Graph inconsistency: TosaReference::Tensor %s is a subgraph input and has a producer\n",
+ WARNING("Graph inconsistency: TosaReference::Tensor %s has no producers or consumers\n",
currTensor->getName().c_str());
return 1;
}
}
- // comment this check out as this is possible when graph have multiple output
- // for example:
- // %0 = add(%arg0, %arg1)
- // %1 = mul(%arg0, %0)
- // yields(%0, %1)
- //if (currTensor->getIsSubgraphOutput()) {
- // if (!currTensor->getConsumers().empty()) {
- // WARNING ("Graph inconsistency: TosaReference::Tensor %s is a subgraph output and has a consumer\n",
- // currTensor->getName().c_str());
- // return 1;
- // }
- //}
-
if (g_func_config.tosa_profile == 0)
{
DType dtype = currTensor->getDtype();