@@ -8,16 +8,6 @@ namespace lowering {
8
8
namespace passes {
9
9
10
10
void 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
-
21
11
std::string to_type_as_pattern = R"IR(
22
12
graph(%input, %other):
23
13
%out : Tensor = aten::type_as(%input, %other)
@@ -30,11 +20,6 @@ void ReduceToOperation(std::shared_ptr<torch::jit::Graph>& graph) {
30
20
%out : Tensor = aten::to(%input, %other, %5, %5, %6)
31
21
return (%out))IR" ;
32
22
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
-
38
23
// replace aten::type_as with aten::to.other
39
24
torch::jit::SubgraphRewriter map_aten_type_as_to_other;
40
25
map_aten_type_as_to_other.RegisterRewritePattern (to_type_as_pattern, to_other_pattern);
0 commit comments