Add lint for unqualified type: ignore (#56290)

Summary:
The other half of https://github.com/pytorch/pytorch/issues/56272.

Pull Request resolved: https://github.com/pytorch/pytorch/pull/56290

Test Plan:
CI should pass on the tip of this PR, and we know that the lint works because the following CI runs (before this PR was finished) failed:

- https://github.com/pytorch/pytorch/runs/2384511062
- https://github.com/pytorch/pytorch/actions/runs/765036024

Reviewed By: seemethere

Differential Revision: D27867219

Pulled By: samestep

fbshipit-source-id: e648f07b6822867e70833e23ddafe7fb7eaca235
This commit is contained in:
Sam Estep
2021-04-21 08:06:05 -07:00
committed by Facebook GitHub Bot
parent 87a1ebc9cd
commit 75024e228c
151 changed files with 587 additions and 580 deletions

View File

@ -1,7 +1,7 @@
import torch
from torch.fx import GraphModule # type: ignore
from torch.fx.symbolic_trace import Tracer # type: ignore
from torch.fx.node import Target, Node, Argument # type: ignore
from torch.fx import GraphModule
from torch.fx.symbolic_trace import Tracer
from torch.fx.node import Target, Node, Argument
from .fx import Fuser # noqa: F401
from .fx import Quantizer # noqa: F401
from .fx.utils import graph_pretty_str # noqa: F401
@ -232,7 +232,7 @@ def fuse_fx(model: torch.nn.Module,
"""
torch._C._log_api_usage_once("quantization_api.quantize_fx.fuse_fx")
assert not model.training, 'fuse_fx only works on models in eval mode'
graph_module = torch.fx.symbolic_trace(model) # type: ignore
graph_module = torch.fx.symbolic_trace(model)
return _fuse_fx(graph_module, fuse_custom_config_dict)
def prepare_fx(