We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent aa957b6 commit 23c61a8Copy full SHA for 23c61a8
dpctl/tests/test_tensor_isin.py
@@ -173,3 +173,22 @@ def test_isin_empty_inputs():
173
def test_isin_validation():
174
with pytest.raises(ExecutionPlacementError):
175
dpt.isin(1, 1)
176
+
177
178
+def test_isin_special_floating_point_vals():
179
+ get_queue_or_skip()
180
181
+ # real and complex nans compare false
182
+ x = dpt.asarray(dpt.nan, dtype="f4")
183
+ test = dpt.asarray(dpt.nan, dtype="f4")
184
+ assert not dpt.isin(x, test)
185
186
+ x = dpt.asarray(dpt.nan, dtype="c8")
187
+ test = dpt.asarray(dpt.nan, dtype="c8")
188
189
190
+ # -0.0 compares equal to +0.0
191
+ x = dpt.asarray(-0.0, dtype="f4")
192
+ test = dpt.asarray(0.0, dtype="f4")
193
+ assert dpt.isin(x, test)
194
+ assert dpt.isin(test, x)
0 commit comments