Skip to content

Commit

Permalink
relax device check in _init_buffer
Browse files Browse the repository at this point in the history
  • Loading branch information
liuanji committed Aug 18, 2024
1 parent c83f6ab commit 679708d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/pyjuice/model/tensorcircuit.py
Original file line number Diff line number Diff line change
Expand Up @@ -735,7 +735,7 @@ def _init_buffer(self, name: str, shape: Tuple, set_value: Optional[float] = Non
if not flag and tensor.size(i) != d:
flag = True

if not flag and check_device and tensor.device != self.device:
if not flag and check_device and self.device.index is not None and tensor.device != self.device:
flag = True

if flag:
Expand Down

0 comments on commit 679708d

Please sign in to comment.