Skip to content

Commit 9164e51

Browse files
ThomasJannaudfacebook-github-bot
authored andcommitted
Make constant_folding's _DEFAULT_SKIP_TARGETS public (#10760)
Summary: This follows D73513516 and allows customers of constant_prop_pass to use previous defaults Differential Revision: D74349918
1 parent 3c21e3a commit 9164e51

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

exir/passes/constant_prop_pass.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,8 @@
2929

3030
# Avoid propagating constants for `exir.ops.edge.aten.full.default`.
3131
# Propagating aten.full can significantly increase compiled model size.
32-
_DEFAULT_SKIP_TARGETS = {exir_ops.edge.aten.full.default}
32+
_DEFAULT_SKIP_TARGETS_NO_QUANT = {exir_ops.edge.aten.full.default}
33+
_DEFAULT_SKIP_TARGETS = set(_DEFAULT_SKIP_TARGETS_NO_QUANT)
3334

3435
# Do not const prop quantization primitives
3536
_QUANT_PRIMITIVES_EDGE = [aten_to_edge(op) for op in _QUANT_PRIMITIVES]
@@ -47,6 +48,9 @@
4748
torch.layout,
4849
)
4950

51+
def get_default_skip_targets_no_quant() -> set[EdgeOpOverload]:
52+
return _DEFAULT_SKIP_TARGETS_NO_QUANT
53+
5054

5155
def is_const(
5256
arg,

0 commit comments

Comments
 (0)