Skip to content
Merged
Changes from 3 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
7 changes: 5 additions & 2 deletions array_api_compat/torch/_aliases.py
Original file line number Diff line number Diff line change
Expand Up @@ -616,8 +616,11 @@ 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)
return torch.empty(0, device=device, **kwargs).to(dtype)
try:
return torch.arange(start, stop, step, dtype=dtype, device=device, **kwargs)
except (NotImplementedError, RuntimeError):
Comment thread
ev-br marked this conversation as resolved.
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