Skip to content

Commit 72b4e08

Browse files
metascroyfacebook-github-bot
authored andcommitted
Handle case when native_schema is None
Summary: https://fb.workplace.com/groups/pytorch.edge.users/posts/1714672769403009/?comment_id=1721960698674216 Differential Revision: D71413713
1 parent 0e5f309 commit 72b4e08

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

exir/program/_program.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -995,13 +995,13 @@ def keep(op):
995995

996996
schema = op._schema
997997
native_schema = _pybind_schema_to_native_schema(schema)
998-
if native_schema.is_mutable:
998+
if (native_schema is not None) and native_schema.is_mutable:
999999
logging.warn(
10001000
f"Op {op} was requested for preservation by partitioner. This request is ignored because it is mutable."
10011001
)
10021002
return False
10031003

1004-
if native_schema.aliased_return_names() != [None]:
1004+
if (native_schema is not None) and native_schema.aliased_return_names() != [None]:
10051005
logging.warn(
10061006
f"Op {op} was requested for preservation by partitioner. This request is ignored because it aliases output."
10071007
)

0 commit comments

Comments
 (0)