Skip to content

np.intN types give TypeErrors #4985

@alok

Description

@alok
  • OS: macos 10.11.6
  • PyTorch version: 0.3post4
  • How you installed PyTorch (conda, pip, source): pip
  • Python version: 3.6.3

torch.Tensor(np.int64(1)) gives a TypeError because torch expects ints, and it got the type np.int64. However, that's still an int (for all practical purposes, even if isinstance(np.int64(1), int) equals False.

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