Fix usage of TF_LITE_ENSURE_MSG in constructor

This commit is contained in:
Mihai Maruseac 2021-06-04 14:06:01 -07:00 committed by GitHub
parent fc407649b8
commit b432db5806
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -151,11 +151,7 @@ class SubgraphGuard {
SubgraphGuard(TfLiteContext* context, bool* is_subgraph_in_use)
: is_subgraph_in_use_(is_subgraph_in_use) {
if (*is_subgraph_in_use_) {
TF_LITE_ENSURE_MSG(
context, false,
"Subgraph is already in use. Using an interpreter or a subgraph in "
"multiple threads is not supported. Recursion in the graph is not "
"supported.");
context->ReportError(context, "Subgraph is already in use.");
status_ = kTfLiteError;
} else {
*is_subgraph_in_use_ = true;