Skip to content

Commit 5e86901

Browse files
committed
fix?
1 parent 8fbdb17 commit 5e86901

File tree

1 file changed

+17
-10
lines changed

1 file changed

+17
-10
lines changed

exir/memory_planning.py

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff 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 = _does_user_input_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 _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+
342349
def get_graph_input_tensors(
343350
nodes: Iterable[Node], graph_signature: Optional[ExportGraphSignature] = None
344351
) -> Set[TensorSpec]:

0 commit comments

Comments
 (0)