Skip to content

Conversation

ev-br
Copy link
Member

@ev-br ev-br commented Apr 15, 2025

towards #299

@ev-br
Copy link
Member Author

ev-br commented Apr 15, 2025

Merging straight away so that data-apis/array-api-compat#306 can run it across backends.

@ev-br ev-br merged commit 2db6c7b into data-apis:master Apr 15, 2025
3 checks passed
Copy link
Contributor

@crusaderky crusaderky left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing test case for Python scalars (with ad-hoc behaviour when the python scalar is x1)

@ev-br
Copy link
Member Author

ev-br commented Apr 15, 2025

Missing test case for Python scalars (with ad-hoc behaviour when the python scalar is x1)

Not really:

$ git diff
diff --git a/array_api_tests/test_operators_and_elementwise_functions.py b/array_api_tests/test_operators_and_elementwise_functions.py
index 6b4e555..2f9d9b7 100644
--- a/array_api_tests/test_operators_and_elementwise_functions.py
+++ b/array_api_tests/test_operators_and_elementwise_functions.py
@@ -1850,6 +1850,8 @@ def _filter_zero(x):
 )
 @given(x1x2=hh.array_and_py_scalar(dh.real_float_dtypes))
 def test_binary_with_scalars_real(func_data, x1x2):
+    if isinstance(x1x2[0], float):
+        breakpoint()
     _check_binary_with_scalars(func_data, x1x2)

stops with

-> _check_binary_with_scalars(func_data, x1x2)
(Pdb) p x1x2
(63.0, tensor([[ 0.6733,  0.3333, 26.0324,  1.9000]]))

int scalars, are missing yes. This is on par with testing other binary functions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants