Skip to content

Commit 6478709

Browse files
ev-brlezcano
andauthored
Update torch_np/_detail/implementations.py
Co-authored-by: Mario Lezcano Casado <[email protected]>
1 parent 9328f11 commit 6478709

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

torch_np/_detail/implementations.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -507,7 +507,7 @@ def arange(start=None, stop=None, step=1, dtype=None):
507507

508508
if (step > 0 and start > stop) or (step < 0 and start < stop):
509509
# empty range
510-
return torch.as_tensor([], dtype=target_dtype)
510+
return torch.empty(0, dtype=target_type)
511511

512512
try:
513513
result = torch.arange(start, stop, step, dtype=work_dtype)

0 commit comments

Comments
 (0)