Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: unify the torch.Tensor.cuda frontends #28827

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading