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:
248
248
has_dynamic_unbound_output |= has_dynamic_unbound_tensor
249
249
250
250
# 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 = _does_user_input_exist (graph_signature = self .graph_signature )
261
252
262
253
if "placeholder" in check_list and user_inputs_exist :
263
254
assert graph_input_allocated is not None , "graph_input_allocated not set"
@@ -339,6 +330,22 @@ def _is_mutable_buffer(
339
330
return False
340
331
341
332
333
+ def _does_user_input_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
+
342
349
def get_graph_input_tensors (
343
350
nodes : Iterable [Node ], graph_signature : Optional [ExportGraphSignature ] = None
344
351
) -> Set [TensorSpec ]:
You can’t perform that action at this time.
0 commit comments