Skip to content

Commit

Permalink
Use torch.arange instead of torch.range in test_torch.py (pytorch#1996)
Browse files Browse the repository at this point in the history
  • Loading branch information
lynic authored and soumith committed Jul 7, 2017
1 parent 73fead9 commit 90d0762
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions test/test_torch.py
Original file line number Diff line number Diff line change
Expand Up @@ -392,7 +392,7 @@ def test_remainder(self):
m1 = torch.Tensor(10, 10).uniform_(-10., 10.)
res1 = m1.clone()
res2 = m1.clone()
qs = torch.range(-5.1, 4.1)
qs = torch.arange(-5.1, 4.1)
# Check the case where the divisor is a simple float
for col_idx, q in enumerate(qs):
# Reference
Expand All @@ -410,7 +410,7 @@ def test_remainder(self):
long_m1 = torch.LongTensor(10, 10).random_(-10, 10)
long_res1 = long_m1.clone()
long_res2 = long_m1.clone()
long_qs = torch.range(-5, 4).long()
long_qs = torch.arange(-5, 5).long()
long_qs[5] = 5 # Can't handle the divisor=0 case
for col_idx, long_q in enumerate(long_qs):
# Reference
Expand Down

0 comments on commit 90d0762

Please sign in to comment.