File tree Expand file tree Collapse file tree 1 file changed +19
-10
lines changed Expand file tree Collapse file tree 1 file changed +19
-10
lines changed Original file line number Diff line number Diff line change @@ -248,16 +248,9 @@ 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_inputs_exist (
252
+ graph_signature = self .graph_signature
253
+ )
261
254
262
255
if "placeholder" in check_list and user_inputs_exist :
263
256
assert graph_input_allocated is not None , "graph_input_allocated not set"
@@ -339,6 +332,22 @@ def _is_mutable_buffer(
339
332
return False
340
333
341
334
335
+ def _does_user_inputs_exist (graph_signature : Optional [ExportGraphSignature ]) -> bool :
336
+ if graph_signature is None :
337
+ return False
338
+
339
+ return (
340
+ len (
341
+ list (
342
+ filter (
343
+ lambda input : input .kind == InputKind .USER_INPUT ,
344
+ graph_signature .input_specs ,
345
+ )
346
+ )
347
+ )
348
+ ) > 0
349
+
350
+
342
351
def get_graph_input_tensors (
343
352
nodes : Iterable [Node ], graph_signature : Optional [ExportGraphSignature ] = None
344
353
) -> Set [TensorSpec ]:
You can’t perform that action at this time.
0 commit comments