Skip to content

torch.randperm does not respect TH_INDEX_BASE #911

@soumith

Description

@soumith

Currently, torch.randperm(10) returns

In [6]: torch.randperm(10)
Out[6]:

 2
 3
 7
 4
 9
 8
 5
 6
 1
 0
[torch.LongTensor of size 10]

This is clearly wrong and unexpected behavior. Needs to return numbers in range [1, 10]

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions