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

[Bug] Passing other: Tensor to LinearOperator.to. #44

Closed
j-wilson opened this issue Jan 2, 2023 · 0 comments
Closed

[Bug] Passing other: Tensor to LinearOperator.to. #44

j-wilson opened this issue Jan 2, 2023 · 0 comments
Labels
bug Something isn't working

Comments

@j-wilson
Copy link

j-wilson commented Jan 2, 2023

🐛 Bug

torch.Tensor.to allows the user to provide a reference tensor in lieu of explicitly passing device and dtype; however, this logic seems to be missing from LinearOperator.to.

To reproduce

A = DiagLinearOperator(torch.rand(3, dtype=torch.float64))
B = A.to(torch.rand(3, dtype=torch.float32))
B.dtype
> torch.float64

Expected Behavior

The code should either follow the same convention as torch.Tensor.to or raise an exception.

@j-wilson j-wilson added the bug Something isn't working label Jan 2, 2023
@j-wilson j-wilson changed the title [Bug] Passingother: Tensor to LinearOperator.to. [Bug] Passing other: Tensor to LinearOperator.to. Jan 2, 2023
Balandat added a commit to Balandat/linear_operator that referenced this issue Jan 2, 2023
Balandat added a commit to Balandat/linear_operator that referenced this issue Jan 2, 2023
Balandat added a commit to Balandat/linear_operator that referenced this issue Jan 2, 2023
Balandat added a commit to Balandat/linear_operator that referenced this issue Jan 2, 2023
@Balandat Balandat closed this as completed Jan 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants