aboutsummaryrefslogtreecommitdiff
path: root/reference_model/src/main.cpp
diff options
context:
space:
mode:
authorKevin Cheng <kevin.cheng@arm.com>2021-10-14 17:09:57 -0700
committerKevin Cheng <kevin.cheng@arm.com>2021-10-18 18:50:08 +0000
commitcc61be36c3b0f5cd1ea719e129a54fd48a6ee9a2 (patch)
tree2d664f87e3fdd75de8c6794f6f6c8d6364ece6bb /reference_model/src/main.cpp
parente807aae606a78d923a2565052f7c2179e3050650 (diff)
downloadreference_model-cc61be36c3b0f5cd1ea719e129a54fd48a6ee9a2.tar.gz
More ERROR_IF supports
- Also delay tensor allocation after operator being validated ERROR_IF can be caught first before 0 or negative dimension set the graph_status to UNPREDICTABLE - Rescale, Argmax, FullyConnected, Matmul, Pad, Reshape, Slice, Transpose, Clamp, Concat, Equal, Greater, GreaterEqual, Table Signed-off-by: Kevin Cheng <kevin.cheng@arm.com> Change-Id: I4e1b3e5794fe195ce1a37e28443ae584645a3b91
Diffstat (limited to 'reference_model/src/main.cpp')
-rw-r--r--reference_model/src/main.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/reference_model/src/main.cpp b/reference_model/src/main.cpp
index e04a20b..0bf0697 100644
--- a/reference_model/src/main.cpp
+++ b/reference_model/src/main.cpp
@@ -84,6 +84,12 @@ int main(int argc, const char** argv)
goto done;
}
+ if (main_gt.allocateTensor())
+ {
+ WARNING("Failed to allocate tensor. Evaluation aborted.");
+ goto done;
+ }
+
if (g_func_config.validate_only)
{
goto done;
@@ -251,9 +257,9 @@ int readInputTensors(SubgraphTraverser& gt, json test_desc)
DEBUG_MED(GT, "Loading input tensor %s from filename: %s", tensor->getName().c_str(), filename);
- if (tensor->allocate())
+ if (!tensor->is_allocated())
{
- WARNING("Fail to allocate tensor %s", tensor->getName().c_str());
+ WARNING("Tensor %s is not allocated before being initialized", tensor->getName().c_str());
return 1;
}