Skip to content

LGTM.com - false positive - Non-callable class errors for classes that inherit from callable torch.nn.Module�?#4183

@mfl28

Description

@mfl28

Description of the false positive

I get Call to a non-callable of class ... error alerts for PyTorch classes that inherit from the callable torch.nn.Module class:

  1. Class torch.nn.CrossEntropyLoss
    This class inherits from _WeightedLoss which inherits form _Loss which inherits from torch.nn.Module (see here for the source code).
  2. Class torch.nn.ReflectionPad2d
    This class inherits from _ReflectionPadNd which inherits from torch.nn.Module (see here for the source code).

torch.nn.Module defines the __call__ method as can be seen here.

URL to the alert on the project page on LGTM.com
CrossEntropyLoss errors: alert-1, alert-2
ReflectionPad2d error: alert

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions