Skip to content

Commit 076fd09

Browse files
cccclaifacebook-github-bot
authored andcommitted
handle case when arg is None
Summary: just add one more case when serializing Reviewed By: tarun292 Differential Revision: D48400642 fbshipit-source-id: b330506929d3fdbd5b681beb6c3157b7483a8769
1 parent ad78291 commit 076fd09

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

sdk/edir/et_schema.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -511,6 +511,14 @@ def _parse_args(
511511
)
512512
elif isinstance(list_arg, torch.fx.node.Node):
513513
arg_name += [FXOperatorGraph._get_node_name(list_arg)]
514+
elif list_arg is None:
515+
arg_name += ["CONST_NONE" + str(const_count)]
516+
const_count += 1
517+
const_node = ValueNode(arg_name[-1], val=str(arg))
518+
nodes[arg_name[-1]] = const_node
519+
FXOperatorGraph._update_module_mapping(
520+
const_node, module_mapping, node.meta
521+
)
514522
else:
515523
raise Exception(
516524
f"Unsupported argument encountered in list {arg}, {type(arg[0])}"

0 commit comments

Comments
 (0)