Add SUBGRAPH_ERROR_IF() to catch graph-level error.
- Also replace SIMPLE_FATAL_ERROR() with FATAL_ERROR() since they're duplicate
- Replace FATAL_ERROR()/ASSERT_MSG() with ERROR_IF_SUBGRAPH() if the condition is a graph error
FATAL_ERROR()/ASSERT() should only be used by model internal/runtime error like file reading.
Signed-off-by: Kevin Cheng <kevin.cheng@arm.com>
Change-Id: If1e1e2488054a0ecd800fb0f2ea6487019282500
diff --git a/reference_model/src/tensor.h b/reference_model/src/tensor.h
index e97554f..3fa23f9 100644
--- a/reference_model/src/tensor.h
+++ b/reference_model/src/tensor.h
@@ -689,16 +689,7 @@
default:
break;
}
-
- std::string shape_str("[");
- for (auto& dim : shape_)
- {
- shape_str += (std::to_string(dim) + ", ");
- }
- shape_str.append("]");
-
- FATAL_ERROR("Unsupported tensor name=%s, type=%s, rank=%d, shape=%s", tensorName_.c_str(),
- EnumNamesDType()[tensorDtype_], rank, shape_str.c_str());
+ return nullptr;
}
static Tensor* newTensor(DType type, const std::vector<int> shape);