Skip to content
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
10 changes: 8 additions & 2 deletions array_api_compat/torch/_aliases.py
Original file line number Diff line number Diff line change
Expand Up @@ -616,8 +616,14 @@ def arange(start: float,
dtype = torch.int64
else:
dtype = torch.float32
return torch.empty(0, dtype=dtype, device=device, **kwargs)
return torch.arange(start, stop, step, dtype=dtype, device=device, **kwargs)
try:
return torch.empty(0, dtype=dtype, device=device, **kwargs)
except NotImplementedError:
return torch.empty(0, device=device, **kwargs).to(dtype)
try:
return torch.arange(start, stop, step, dtype=dtype, device=device, **kwargs)
except NotImplementedError:
return torch.arange(start, stop, step, device=device, **kwargs).to(dtype)

# torch.eye does not accept None as a default for the second argument and
# doesn't support off-diagonals (https://github.com/pytorch/pytorch/issues/70910)
Expand Down
Loading