@@ -8,16 +8,6 @@ namespace lowering {
88namespace passes {
99
1010void ReduceToOperation (std::shared_ptr<torch::jit::Graph>& graph) {
11- std::string to_dtype_layout_pattern = R"IR(
12- graph(%x, %dtype, %layout, %device, %pm, %nb, %copy, %format):
13- %out : Tensor = aten::to(%x, %dtype, %layout, %device, %pm, %nb, %copy, %format)
14- return (%out))IR" ;
15-
16- std::string to_dtype_multi_input_pattern = R"IR(
17- graph(%x, %dtype, %layout, %device, %pm, %nb, %copy, %format):
18- %out : Tensor = aten::to(%x, %device, %dtype, %nb, %copy, %format)
19- return (%out))IR" ;
20-
2111 std::string to_type_as_pattern = R"IR(
2212 graph(%input, %other):
2313 %out : Tensor = aten::type_as(%input, %other)
@@ -30,11 +20,6 @@ void ReduceToOperation(std::shared_ptr<torch::jit::Graph>& graph) {
3020 %out : Tensor = aten::to(%input, %other, %5, %5, %6)
3121 return (%out))IR" ;
3222
33- // replace aten::to.dtype_layout with aten::to.dtype
34- torch::jit::SubgraphRewriter map_aten_dtype_layout;
35- map_aten_dtype_layout.RegisterRewritePattern (to_dtype_layout_pattern, to_dtype_multi_input_pattern);
36- map_aten_dtype_layout.runOnGraph (graph);
37-
3823 // replace aten::type_as with aten::to.other
3924 torch::jit::SubgraphRewriter map_aten_type_as_to_other;
4025 map_aten_type_as_to_other.RegisterRewritePattern (to_type_as_pattern, to_other_pattern);
0 commit comments