File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed
onnx_diagnostic/reference Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -479,8 +479,11 @@ def _get_hidden_inputs(self, graph: GraphProto) -> Set[str]:
479479 used by a subgraph.
480480 """
481481 hidden = set ()
482- memo = set (i .name for i in graph .initializer )
483- memo |= set (i .name for i in graph .sparse_initializer )
482+ memo = (
483+ {i .name for i in graph .initializer }
484+ | {i .name for i in graph .sparse_initializer }
485+ | {i .name for i in graph .input }
486+ )
484487 for node in graph .node :
485488 for i in node .input :
486489 if i not in memo :
@@ -627,6 +630,10 @@ def _get_sess_init_subgraph(
627630 unique_names .add (i )
628631 value = oh .make_tensor_value_info (i , dtype_to_tensor_dtype (v .dtype ), v .shape )
629632 vinputs .append (value )
633+ assert len (reduced_set & set (context )) == len (reduced_set ), (
634+ f"Missing hidden inputs { sorted (reduced_set )} from context={ sorted (context )} "
635+ f"(len(inputs)={ len ([i for i in inputs if i ])} ) for node { pretty_onnx (node )} "
636+ )
630637 return vinputs
631638
632639 def _get_sess_if (
You can’t perform that action at this time.
0 commit comments