Skip to content

Commit d282e3a

Browse files
committed
remove redundant tests from floating point classifying functions
1 parent 053f756 commit d282e3a

File tree

3 files changed

+0
-59
lines changed

3 files changed

+0
-59
lines changed

dpctl/tests/elementwise/test_isfinite.py

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,8 @@
1414
# See the License for the specific language governing permissions and
1515
# limitations under the License.
1616

17-
import itertools
18-
1917
import numpy as np
2018
import pytest
21-
from numpy.testing import assert_allclose
2219

2320
import dpctl.tensor as dpt
2421
from dpctl.tests.helper import get_queue_or_skip, skip_if_dtype_not_supported
@@ -80,20 +77,3 @@ def test_isfinite_floats(dtype):
8077
r = dpt.empty_like(Y, dtype="bool")
8178
dpt.isfinite(Y, out=r)
8279
assert np.array_equal(dpt.asnumpy(r)[()], np.isfinite(Ynp))
83-
84-
85-
@pytest.mark.parametrize("dtype", _all_dtypes)
86-
def test_isfinite_order(dtype):
87-
q = get_queue_or_skip()
88-
skip_if_dtype_not_supported(dtype, q)
89-
90-
arg_dt = np.dtype(dtype)
91-
input_shape = (10, 10, 10, 10)
92-
X = dpt.ones(input_shape, dtype=arg_dt, sycl_queue=q)
93-
94-
for perms in itertools.permutations(range(4)):
95-
U = dpt.permute_dims(X[::2, ::-1, ::-1, ::5], perms)
96-
expected_Y = np.full(U.shape, fill_value=True, dtype=dpt.bool)
97-
for ord in ["C", "F", "A", "K"]:
98-
Y = dpt.isfinite(U, order=ord)
99-
assert_allclose(dpt.asnumpy(Y), expected_Y)

dpctl/tests/elementwise/test_isinf.py

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,8 @@
1414
# See the License for the specific language governing permissions and
1515
# limitations under the License.
1616

17-
import itertools
18-
1917
import numpy as np
2018
import pytest
21-
from numpy.testing import assert_allclose
2219

2320
import dpctl.tensor as dpt
2421
from dpctl.tests.helper import get_queue_or_skip, skip_if_dtype_not_supported
@@ -74,20 +71,3 @@ def test_isinf_floats(dtype):
7471
Ynp = np.repeat(np.array([y1, y2, y3, y4], dtype=dtype), mult)
7572
Y = dpt.asarray(Ynp, sycl_queue=q)
7673
assert np.array_equal(dpt.asnumpy(dpt.isinf(Y)), np.isinf(Ynp))
77-
78-
79-
@pytest.mark.parametrize("dtype", _all_dtypes)
80-
def test_isinf_order(dtype):
81-
q = get_queue_or_skip()
82-
skip_if_dtype_not_supported(dtype, q)
83-
84-
arg_dt = np.dtype(dtype)
85-
input_shape = (10, 10, 10, 10)
86-
X = dpt.ones(input_shape, dtype=arg_dt, sycl_queue=q)
87-
88-
for perms in itertools.permutations(range(4)):
89-
U = dpt.permute_dims(X[::2, ::-1, ::-1, ::5], perms)
90-
expected_Y = np.full(U.shape, fill_value=False, dtype=dpt.bool)
91-
for ord in ["C", "F", "A", "K"]:
92-
Y = dpt.isinf(U, order=ord)
93-
assert_allclose(dpt.asnumpy(Y), expected_Y)

dpctl/tests/elementwise/test_isnan.py

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@
1414
# See the License for the specific language governing permissions and
1515
# limitations under the License.
1616

17-
import itertools
18-
1917
import numpy as np
2018
import pytest
2119

@@ -79,20 +77,3 @@ def test_isnan_floats(dtype):
7977
r = dpt.empty_like(Y, dtype="bool")
8078
dpt.isnan(Y, out=r)
8179
assert np.array_equal(dpt.asnumpy(r)[()], np.isnan(Ynp))
82-
83-
84-
@pytest.mark.parametrize("dtype", _all_dtypes)
85-
def test_isnan_order(dtype):
86-
q = get_queue_or_skip()
87-
skip_if_dtype_not_supported(dtype, q)
88-
89-
arg_dt = np.dtype(dtype)
90-
input_shape = (10, 10, 10, 10)
91-
X = dpt.ones(input_shape, dtype=arg_dt, sycl_queue=q)
92-
93-
for perms in itertools.permutations(range(4)):
94-
U = dpt.permute_dims(X[::2, ::-1, ::-1, ::5], perms)
95-
expected_Y = np.full(U.shape, fill_value=False, dtype=dpt.bool)
96-
for ord in ["C", "F", "A", "K"]:
97-
Y = dpt.isnan(U, order=ord)
98-
assert np.allclose(dpt.asnumpy(Y), expected_Y)

0 commit comments

Comments
 (0)