Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion exir/backend/test/test_backends.py
Original file line number Diff line number Diff line change
Expand Up @@ -1033,7 +1033,7 @@ def false_fn(x, y):

def f(x, y):
x = x + y
x = torch.ops.higher_order.cond(x[0][0] == 1, true_fn, false_fn, [x, y])
x = torch.cond(x[0][0] == 1, true_fn, false_fn, [x, y])
x = x - y
return x

Expand Down
12 changes: 3 additions & 9 deletions exir/tests/control_flow_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,7 @@ def true_branch(x):
def false_branch(x):
return x * x

return torch.ops.higher_order.cond(
inp.sum() > 4, true_branch, false_branch, [inp]
)
return torch.cond(inp.sum() > 4, true_branch, false_branch, [inp])

def get_random_inputs(self):
return (torch.rand(5),)
Expand All @@ -39,9 +37,7 @@ def true_branch(x):
def false_branch(x):
return x * x * x

return torch.ops.higher_order.cond(
inp.sum() > 4, true_branch, false_branch, [inp]
)
return torch.cond(inp.sum() > 4, true_branch, false_branch, [inp])

def get_upper_bound_inputs(self):
return (torch.rand(8),)
Expand Down Expand Up @@ -72,9 +68,7 @@ def true_branch(x):
def false_branch(x):
return x * 2

return torch.ops.higher_order.cond(
inp.sum() > 4, true_branch, false_branch, [inp]
)
return torch.cond(inp.sum() > 4, true_branch, false_branch, [inp])

def get_random_inputs(self):
return (torch.eye(5) * 2,)
Expand Down
4 changes: 1 addition & 3 deletions exir/tests/test_passes.py
Original file line number Diff line number Diff line change
Expand Up @@ -1463,9 +1463,7 @@ def forward(self, pred, x):
out = torch.nn.functional.linear(
x, self.w.to(torch.float16).to(torch.float32)
)
return torch.ops.higher_order.cond(
pred, self.true_fn, self.false_fn, [out]
)
return torch.cond(pred, self.true_fn, self.false_fn, [out])

mod = Module()
x = torch.randn([3, 3])
Expand Down
Loading