Skip to content

Commit 98ea326

Browse files
committed
Update on "[et][dim order] Makes DimOrderOpsMap as an operator to operator mapping"
This diff updates DimOrderOpsMap from name-to-operator mapping to operator-to-operator mapping, which has multiple benefits: 1. Reduce dialect ambiguity. Different dialects op may map to same name (e.g. `aten.to_copy` and `exir_ops.edge.aten._to_copy.default`). Directly using op can diminish the ambiguity. 2. Auto-maintain MemoryFormatOpsMap by reverting DimOrderOpsMap Differential Revision: [D66773612](https://our.internmc.facebook.com/intern/diff/D66773612/) [ghstack-poisoned]
1 parent 91d32cf commit 98ea326

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

exir/passes/dim_order_ops_registry.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,14 +58,14 @@ def _empty_dim_order_out_impl(*args, **kwargs):
5858

5959

6060
"""
61-
Defines a map of aten or edge ops to the corresponding dim_order ops for quick lookup
61+
Defines a map of edge ops to the corresponding dim_order ops for quick lookup
6262
"""
6363
DimOrderOpsMap = {
6464
exir_ops.edge.aten._to_copy.default: exir_ops.edge.dim_order_ops._to_dim_order_copy.default,
6565
exir_ops.edge.aten.empty.memory_format: exir_ops.edge.dim_order_ops._empty_dim_order.default,
6666
}
6767

6868
"""
69-
Defines a map of aten or edge ops to the corresponding memory format ops for quick lookup, which is the revert of DimOrderOpsMap
69+
Defines a map of edge ops to the corresponding memory format ops for quick lookup, which is the revert of DimOrderOpsMap
7070
"""
7171
MemoryFormatOpsMap = {v: k for k, v in DimOrderOpsMap.items()}

0 commit comments

Comments
 (0)