Meaningful warning when nGraph Constant for initializer couldn't be created (#3443)

This commit is contained in:
Bartosz Sledz 2020-12-02 12:17:39 +01:00 committed by GitHub
parent e1a7f7e5af
commit a493224c6b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -95,9 +95,15 @@ namespace ngraph
}
catch (const ngraph::ngraph_error& exc)
{
NGRAPH_WARN << "Could not create an nGraph Constant for initializer '"
<< initializer_tensor.name() << "'. Detailed error:\n"
<< exc.what();
NGRAPH_WARN
<< "\nCould not create an nGraph Constant for initializer '"
<< initializer_tensor.name() << "'. \n"
<< "Constant with a 0 value was created, make sure connected input is "
"optional.\n"
<< "Otherwise verify if the initializer contains a correct number of "
"elements matching the initializer's shape. \n"
<< "Detailed error:\n"
<< exc.what();
ng_constant =
default_opset::Constant::create(tensor.get_ng_type(), Shape{}, {0});
}