Skip to content

Commit 90d0762

Browse files
lynicsoumith
authored andcommitted
Use torch.arange instead of torch.range in test_torch.py (pytorch#1996)
1 parent 73fead9 commit 90d0762

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

test/test_torch.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -392,7 +392,7 @@ def test_remainder(self):
392392
m1 = torch.Tensor(10, 10).uniform_(-10., 10.)
393393
res1 = m1.clone()
394394
res2 = m1.clone()
395-
qs = torch.range(-5.1, 4.1)
395+
qs = torch.arange(-5.1, 4.1)
396396
# Check the case where the divisor is a simple float
397397
for col_idx, q in enumerate(qs):
398398
# Reference
@@ -410,7 +410,7 @@ def test_remainder(self):
410410
long_m1 = torch.LongTensor(10, 10).random_(-10, 10)
411411
long_res1 = long_m1.clone()
412412
long_res2 = long_m1.clone()
413-
long_qs = torch.range(-5, 4).long()
413+
long_qs = torch.arange(-5, 5).long()
414414
long_qs[5] = 5 # Can't handle the divisor=0 case
415415
for col_idx, long_q in enumerate(long_qs):
416416
# Reference

0 commit comments

Comments
 (0)