Handle nullptr for NodeArg.Shape() (#2009)

This commit is contained in:
Scott McKay 2019-10-05 15:00:19 +10:00 committed by GitHub
parent f528da35f2
commit 2a2e6e6641
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -13,6 +13,11 @@ namespace onnxruntime {
static bool CheckConstantInput(const Graph& graph, const NodeArg& input_arg, float expected_value) {
auto shape = input_arg.Shape();
if (shape == nullptr) {
// shape inferencing wasn't able to populate shape information for this NodeArg
return false;
}
auto dim_size = shape->dim_size();
if (dim_size != 0) {
// only check scalar.