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

Make get_bounds_as_ndarray device safe #1567

Closed
wants to merge 1 commit into from

Conversation

saitcakmak
Copy link
Contributor

Summary:
Issue raised in #1566.

The bounds can be a Dict[str, Tuple[Tensor, Tensor]] where the tensors live on GPU, which leads to a device error when trying to assign them to a numpy array.

Differential Revision: D42060124

@facebook-github-bot facebook-github-bot added CLA Signed Do not delete this pull request or issue due to inactivity. fb-exported labels Dec 15, 2022
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D42060124

@codecov
Copy link

codecov bot commented Dec 15, 2022

Codecov Report

Merging #1567 (2df50ae) into main (424c9bc) will not change coverage.
The diff coverage is 100.00%.

❗ Current head 2df50ae differs from pull request most recent head d01be04. Consider uploading reports for the commit d01be04 to get more accurate results

@@            Coverage Diff            @@
##              main     #1567   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files          153       153           
  Lines        13562     13562           
=========================================
  Hits         13562     13562           
Impacted Files Coverage Δ
botorch/optim/utils/numpy_utils.py 100.00% <100.00%> (ø)

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

Copy link
Contributor

@Balandat Balandat left a comment

Choose a reason for hiding this comment

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

thanks for cleaning this up

@Balandat
Copy link
Contributor

Should we add a test for this on both CPU and GPU?

Summary:
Pull Request resolved: pytorch#1567

Issue raised in pytorch#1566.

The `bounds` can be a `Dict[str, Tuple[Tensor, Tensor]]` where the tensors live on GPU, which leads to a device error when trying to assign them to a numpy array.

Reviewed By: Balandat

Differential Revision: D42060124

fbshipit-source-id: 549a0f220edcc34ecdeb2813a2978bde7cab4b6c
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D42060124

@facebook-github-bot
Copy link
Contributor

This pull request has been merged in 6d120db.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed Do not delete this pull request or issue due to inactivity. fb-exported Merged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants