Skip to content

[Minor Bug] Pylint E1101 Module 'torch' has no 'from_numpy' member #701

@willfrey

Description

@willfrey

Very minor but worth mentioning.

Pylint isn't picking up that torch has the member function from_numpy. It's because torch.from_numpy is actually torch._C.from_numpy as far as Pylint is concerned.

According to this stackoverflow thread numpy also suffers from this problem.

For reference, you can have Pylint ignore these by wrapping "problematic" calls with the following comments.

# pylint: disable=E1101
tensor = torch.from_numpy(np_array)
# pylint: enable=E1101

Metadata

Metadata

Assignees

No one assigned

    Labels

    todoNot as important as medium or high priority tasks, but we will work on these.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions