From 2a2e6e6641472beaba2346113a76d06c3a19f6bd Mon Sep 17 00:00:00 2001 From: Scott McKay Date: Sat, 5 Oct 2019 15:00:19 +1000 Subject: [PATCH] Handle nullptr for NodeArg.Shape() (#2009) --- onnxruntime/core/optimizer/gelu_fusion.cc | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/onnxruntime/core/optimizer/gelu_fusion.cc b/onnxruntime/core/optimizer/gelu_fusion.cc index 29854d0aa7..bf7d9d05aa 100644 --- a/onnxruntime/core/optimizer/gelu_fusion.cc +++ b/onnxruntime/core/optimizer/gelu_fusion.cc @@ -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.