From cc61be36c3b0f5cd1ea719e129a54fd48a6ee9a2 Mon Sep 17 00:00:00 2001 From: Kevin Cheng Date: Thu, 14 Oct 2021 17:09:57 -0700 Subject: 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 Change-Id: I4e1b3e5794fe195ce1a37e28443ae584645a3b91 --- reference_model/src/main.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'reference_model/src/main.cpp') 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; } -- cgit v1.2.1