Skip to content

Commit

Permalink
Update src/qibo/backends/pytorch.py
Browse files Browse the repository at this point in the history
Co-authored-by: BrunoLiegiBastonLiegi <[email protected]>
  • Loading branch information
renatomello and BrunoLiegiBastonLiegi authored Mar 12, 2024
1 parent 7c47114 commit 0ab3372
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/qibo/backends/pytorch.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def __init__(self, dtype):
self.dtype = torch_dtype_dict[dtype]

def _cast(self, x, dtype):
return self.torch.tensor(x, dtype=dtype)
return self.torch.as_tensor(x, dtype=dtype)

def Unitary(self, u):
return self._cast(u, dtype=self.dtype)
Expand Down

0 comments on commit 0ab3372

Please sign in to comment.