File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed
orttraining/orttraining/core/graph Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -222,7 +222,12 @@ Node& AppendEventNode(
222222 std::string& new_output_name) { // First output of the created event operator.
223223 // Outputs of "node" should be detached from its consumers.
224224 // Consumers of "node" should consume outputs of the added event operator.
225- std::vector<NodeArg*> node_args = node->MutableOutputDefs ();
225+ // Avoid adding non-existent argumements as new inputs,
226+ // this would trigger a failure in the shape inference phase of graph resolve.
227+ std::vector<NodeArg*> node_args;
228+ std::copy_if (node->MutableOutputDefs ().begin (), node->MutableOutputDefs ().end (),
229+ std::back_inserter (node_args),
230+ [](NodeArg* arg) { return arg->Exists (); });
226231
227232 // Declare outputs of the added event operator.
228233 std::vector<NodeArg*> new_node_args = CreateMirrorNodeArgs (graph, node_args);
You can’t perform that action at this time.
0 commit comments