Skip to content

There is a bug in function "idx_sample" in utils.py. #1

@HXFlowerSea

Description

@HXFlowerSea

Bug codes: random_add = torch.randint(low=1, high=num_idx, device='cpu')
There is a missing parameter in torch.randint() : size. So when I execute the codes, there is a error:
TypeError: randint() received an invalid combination of arguments - got (device=str, high=int, low=int, ), but expected one of:

  • (int high, tuple of ints size, *, torch.Generator generator, Tensor out, torch.dtype dtype, torch.layout layout, torch.device device, bool requires_grad)
  • (int low, int high, tuple of ints size, *, torch.Generator generator, Tensor out, torch.dtype dtype, torch.layout layout, torch.device device, bool requires_grad)

Although it is not a serious issue, I hope you can update the source code in your Github repository, because I think the code released needs to have a certain correctness.

Reference:
torch.randint

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions