Skip to content

Commit d1a7f97

Browse files
ThomasJannaudfacebook-github-bot
authored andcommitted
: constant fold None (#10755)
Summary: Constant folding should fold 'None' and consider it a constant Reviewed By: dulinriley Differential Revision: D74280168
1 parent ee6cf99 commit d1a7f97

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

exir/passes/constant_prop_pass.py

+2
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,8 @@ def is_const(
6161
)
6262
elif isinstance(arg, _PRIMITIVE_TYPES):
6363
return True
64+
elif arg is None:
65+
return True
6466
elif not isinstance(arg, torch.fx.Node):
6567
return False
6668
elif arg in const_node_to_tensor:

0 commit comments

Comments
 (0)