Skip to content

Commit

Permalink
fix: unify the torch.Tensor.cuda frontends
Browse files Browse the repository at this point in the history
  • Loading branch information
Sam-Armstrong committed Sep 18, 2024
1 parent bcde696 commit b8f3a5c
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions ivy/functional/frontends/torch/tensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,11 +126,6 @@ def itemsize(self):
# Setters #
# --------#

@device.setter
def cuda(self, device=None):
self.device = device
return self

@ivy_array.setter
def ivy_array(self, array):
self._ivy_array = array if isinstance(array, ivy.Array) else ivy.array(array)
Expand Down Expand Up @@ -728,8 +723,8 @@ def detach_(self):
def cpu(self):
return ivy.to_device(self.ivy_array, "cpu")

def cuda(self):
return ivy.to_device(self.ivy_array, "gpu:0")
def cuda(self, device=None, non_blocking=False, memory_format=None):
return self.to("cuda" if device is None else device)

@with_unsupported_dtypes({"2.2 and below": ("uint16",)}, "torch")
@numpy_to_torch_style_args
Expand Down

0 comments on commit b8f3a5c

Please sign in to comment.