[Bug] Passing `other: Tensor` to `LinearOperator.to`.
j-wilson opened this issue Β· comments
π 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.