Skip to content

Commit

Permalink
add nullptr check
Browse files Browse the repository at this point in the history
  • Loading branch information
ajindal1 committed Sep 19, 2023
1 parent c50c64a commit 1019e2e
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions onnxruntime/core/optimizer/layer_norm_fusion.cc
Original file line number Diff line number Diff line change
Expand Up @@ -682,6 +682,9 @@ Status SimplifiedLayerNormFusion::ApplyImpl(Graph& graph, bool& modified, int gr
NodeArg* scale = nullptr;
for (size_t i = 0; i < mul_node.MutableInputDefs().size(); i++) {
#ifdef ENABLE_TRAINING_CORE
if (mul_node.MutableInputDefs()[i]->Shape() == nullptr) {
continue;
}
if (axes_values.empty() ||
mul_node.MutableInputDefs()[i]->Shape()->dim_size() == static_cast<int>(axes_values.size())) {
scale = mul_node.MutableInputDefs()[i];
Expand Down

0 comments on commit 1019e2e

Please sign in to comment.