8000 Fixing bug in `get_namespace_and_device`. by drivanov · Pull Request #30647 · scikit-learn/scikit-learn · GitHub
[go: up one dir, main page]

Skip to content

Fixing bug in get_namespace_and_device. #30647

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

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions sklearn/utils/_array_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -619,11 +619,10 @@ def get_namespace_and_device(*array_list, remove_none=True, remove_types=(str,))
skip_remove_kwargs = dict(remove_none=False, remove_types=[])

xp, is_array_api = get_namespace(*array_list, **skip_remove_kwargs)
arrays_device = device(*array_list, **skip_remove_kwargs)
if is_array_api:
return xp, is_array_api, arrays_device
return xp, is_array_api, device(*array_list, **skip_remove_kwargs)
else:
return xp, False, arrays_device
return xp, False, None


def _expit(X, xp=None):
Expand Down
Loading
0