Skip to content

Commit

Permalink
[Tests] Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
zhengyang committed Sep 14, 2024
1 parent 7faca9c commit 2452ab0
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions tests/test_binary_pointwise_ops.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
from .conftest import TO_CPU


def remove_zero(inp):
def replace_zeros(inp):
return torch.where(inp == 0, 1, inp)


Expand Down Expand Up @@ -359,8 +359,8 @@ def test_accuracy_floor_div_int(shape, dtype):
device="cuda",
)
if TO_CPU:
inp1 = remove_zero(inp1)
inp2 = remove_zero(inp2)
inp1 = replace_zeros(inp1)
inp2 = replace_zeros(inp2)
ref_inp1 = to_reference(inp1, False)
ref_inp2 = to_reference(inp2, False)

Expand Down Expand Up @@ -402,8 +402,8 @@ def test_accuracy_remainder(shape, dtype):
device="cuda",
)
if TO_CPU:
inp1 = remove_zero(inp1)
inp2 = remove_zero(inp2)
inp1 = replace_zeros(inp1)
inp2 = replace_zeros(inp2)
ref_inp1 = to_reference(inp1, False)
ref_inp2 = to_reference(inp2, False)

Expand Down

0 comments on commit 2452ab0

Please sign in to comment.