aboutsummaryrefslogtreecommitdiff
path: root/reference_model/src/subgraph_traverser.cc
diff options
context:
space:
mode:
Diffstat (limited to 'reference_model/src/subgraph_traverser.cc')
-rw-r--r--reference_model/src/subgraph_traverser.cc16
1 files changed, 16 insertions, 0 deletions
diff --git a/reference_model/src/subgraph_traverser.cc b/reference_model/src/subgraph_traverser.cc
index 789bcae..082f802 100644
--- a/reference_model/src/subgraph_traverser.cc
+++ b/reference_model/src/subgraph_traverser.cc
@@ -130,6 +130,22 @@ int SubgraphTraverser::initializeGraph()
}
}
+ // if dtype/rank still not initialized with above pass, we initialize without Usage check
+ if (in_dtype == DType_UNKNOWN && in_rank == 0)
+ {
+ for (auto name : op->GetInputTensorNames())
+ {
+ TosaSerializationTensor* ts = block->GetTensorByName(name);
+ ASSERT_MSG(ts, "SubgraphTraverser: fail to get tensor %s from TosaSerializationHandler", name.c_str());
+
+ if (ts->GetShape().size() >= in_rank)
+ {
+ in_dtype = ts->GetDtype();
+ in_rank = ts->GetShape().size();
+ }
+ }
+ }
+
for (auto name : op->GetOutputTensorNames())
{