-
-
Notifications
You must be signed in to change notification settings - Fork 25.9k
TST Fix array API test_fill_or_add_to_diagonal
#31439
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
test_fill_or_add_to_diagonal
test_fill_or_add_to_diagonal
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't understand the purpose of the test anymore: the original numpy array is already an array of ones (it's allocated with zeros before calling numpy.fill_diagonal(array_np, val=1, wrap=wrap)
on it. Then the xp array is created from the numpy array, so it's also an array of ones.
So calling _fill_or_add_to_diagonal
with value=1, add_value=False
is doing nothing.
The intent of the test feels muddled as a result.
I think we should initialize the xp array with zeros instead.
@ogrisel you're right. I fixed the order, because it would have been more difficult to specify dtype using |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM with the following minor suggestion:
Co-authored-by: Olivier Grisel <olivier.grisel@ensta.org>
Co-authored-by: Olivier Grisel <olivier.grisel@ensta.org>
Co-authored-by: Olivier Grisel <olivier.grisel@ensta.org>
Co-authored-by: Olivier Grisel <olivier.grisel@ensta.org>
Reference Issues/PRs
dtype_name
from parametrization intest_fill_or_add_to_diagonal
.array_api_dispatch
configWhat does this implement/fix? Explain your changes.
Any other comments?
@OmarManzoor I think this test should use the
dtype_name
parametrizations, and not just test int64?