Skip to content
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

Fix a bug that wrongly dispatched compute to cpu #3

Merged
merged 2 commits into from
Oct 11, 2023

Conversation

fcharras
Copy link
Collaborator

It only used the device set by SKLEARN_PYTORCH_ENGINE_DEFAULT_DEVICE and always CPU if not set.

if device is None:
device = get_torch_default_device()
return device
return os.getenv("SKLEARN_PYTORCH_ENGINE_DEFAULT_DEVICE", None)
Copy link
Contributor

Choose a reason for hiding this comment

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

I think you should remove get_torch_default_device if it's no longer used anywhere.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

it is used in kmeans/engine.py

@fcharras fcharras merged commit a749c90 into main Oct 11, 2023
2 checks passed
@ogrisel ogrisel deleted the fix/device_validation branch October 11, 2023 14:46
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