We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 166177d commit 55332f4Copy full SHA for 55332f4
optiland/backend/torch_backend.py
@@ -835,12 +835,12 @@ def wrapped(x: Tensor) -> Tensor:
835
# Conversion and Utilities
836
# --------------------------
837
def atleast_1d(x: ArrayLike) -> Tensor:
838
- t = torch.as_tensor(x, dtype=get_precision())
+ t = torch.as_tensor(x, dtype=get_precision(), device=get_device())
839
return t.unsqueeze(0) if t.ndim == 0 else t
840
841
842
def atleast_2d(x: ArrayLike) -> Tensor:
843
844
if t.ndim == 0:
845
return t.unsqueeze(0).unsqueeze(0)
846
if t.ndim == 1:
0 commit comments