-
Notifications
You must be signed in to change notification settings - Fork 26.3k
Closed
Description
torch.arange has a different behavior than np.arange
torch.arange(0, 10) returns a FloatTensor, but shouldn't it be a LongTensor?
Also, torch.arange(10), which I would expect to behave like torch.arange(0, 10), fails, and returns:
TypeError: torch.arange received an invalid combination of arguments - got (float), but expected one of:
* (float start, float end)
* (float start, float end, float step)
np.arange can also take float as input, and in that case will return a float array instead of a int64 array. Could we have something similar in pytorch? If inputs are int, return a LongTensor, if they are float, return a FloatTensor?
fritzo, arendu-zz and colesbury
Metadata
Metadata
Assignees
Labels
No labels