-
Notifications
You must be signed in to change notification settings - Fork 26.3k
Closed
Labels
module: docsRelated to our documentation, both in docs/ and docblocksRelated to our documentation, both in docs/ and docblockstriagedThis issue has been looked at a team member, and triaged and prioritized into an appropriate moduleThis issue has been looked at a team member, and triaged and prioritized into an appropriate module
Description
📚 Documentation
As described here the output size of torch.arange is int((end-start)/step) (i.e. the floor). But it's the ceiling:
import torch
import numpy as np
def verify_out_shape(start, end, steps):
for s in steps:
dif = end-start
assert torch.arange(start, end, step=s).size(0) == np.ceil(dif/s)
verify_out_shape(1, 400, [0.5, 0.7, 0.3, 1.3])
verify_out_shape(23, 731, [0.5, 0.7, 0.3, 1.3]) Metadata
Metadata
Assignees
Labels
module: docsRelated to our documentation, both in docs/ and docblocksRelated to our documentation, both in docs/ and docblockstriagedThis issue has been looked at a team member, and triaged and prioritized into an appropriate moduleThis issue has been looked at a team member, and triaged and prioritized into an appropriate module