File tree Expand file tree Collapse file tree 1 file changed +17
-10
lines changed Expand file tree Collapse file tree 1 file changed +17
-10
lines changed Original file line number Diff line number Diff line change @@ -248,16 +248,7 @@ def verify_graph_input_output(self) -> None:
248248 has_dynamic_unbound_output |= has_dynamic_unbound_tensor
249249
250250 # only check if inputs are allocated if there are user inputs:
251- user_inputs_exist = (
252- len (
253- list (
254- filter (
255- lambda input : input .kind == InputKind .USER_INPUT ,
256- self .graph_signature .input_specs ,
257- )
258- )
259- )
260- ) > 0
251+ user_inputs_exist = _do_user_inputs_exist (graph_signature = self .graph_signature )
261252
262253 if "placeholder" in check_list and user_inputs_exist :
263254 assert graph_input_allocated is not None , "graph_input_allocated not set"
@@ -339,6 +330,22 @@ def _is_mutable_buffer(
339330 return False
340331
341332
333+ def _do_user_inputs_exist (graph_signature : Optional [ExportGraphSignature ]) -> bool :
334+ if graph_signature is None :
335+ return False
336+
337+ return (
338+ len (
339+ list (
340+ filter (
341+ lambda input : input .kind == InputKind .USER_INPUT ,
342+ graph_signature .input_specs ,
343+ )
344+ )
345+ )
346+ ) > 0
347+
348+
342349def get_graph_input_tensors (
343350 nodes : Iterable [Node ], graph_signature : Optional [ExportGraphSignature ] = None
344351) -> Set [TensorSpec ]:
You can’t perform that action at this time.
0 commit comments