Skip to content

Commit 4129ebe

Browse files
authored
Avoid directly calling the map operator
Differential Revision: D74036464 Pull Request resolved: pytorch#10638
1 parent 3ca6cbb commit 4129ebe

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

exir/tests/control_flow_models.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
# LICENSE file in the root directory of this source tree.
66

77
import torch
8+
from torch._higher_order_ops.map import map as torch_map
89
from torch.nn import Module # @manual
910

1011

@@ -87,7 +88,7 @@ def forward(self, xs, y):
8788
def f(x, y):
8889
return x + y
8990

90-
return torch.ops.higher_order.map(f, xs, y) + xs
91+
return torch_map(f, xs, y) + xs
9192

9293
def get_random_inputs(self):
9394
return torch.rand(2, 4), torch.rand(4)
@@ -101,7 +102,7 @@ def forward(self, xs, y):
101102
def f(x, y):
102103
return x + y
103104

104-
return torch.ops.higher_order.map(f, xs, y) + xs
105+
return torch_map(f, xs, y) + xs
105106

106107
def get_upper_bound_inputs(self):
107108
return torch.rand(4, 4), torch.rand(4)

0 commit comments

Comments
 (0)