Skip to content

Commit

Permalink
Delete stub file to enable mypy check
Browse files Browse the repository at this point in the history
Summary:
X-link: pytorch/pytorch#88701

X-link: pytorch/tnt#269

X-link: facebookresearch/ReAgent#691

X-link: pytorch/torchsnapshot#129

X-link: pytorch/torchrec#799

Pull Request resolved: facebookresearch#4649

Context in https://fburl.com/4irjskbe

This change deletes distributed.pyi, so that lintrunner will run mypy on distributed.py for typing check.
It also helps to fix a lot pyre false alarms, so that we can remove those pyre suppressions.

Reviewed By: zhaojuanmao

Differential Revision: D41028360

fbshipit-source-id: 577f212ca4c47e23a8577c4b92385c483f96e2c1
  • Loading branch information
yhcharles authored and facebook-github-bot committed Nov 9, 2022
1 parent f755c49 commit 2d6106b
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions projects/DensePose/densepose/engine/trainer.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,6 @@ def extract_embedder_from_model(cls, model: nn.Module) -> Optional[Embedder]:
if isinstance(model, nn.parallel.DistributedDataParallel):
model = model.module
if hasattr(model, "roi_heads") and hasattr(model.roi_heads, "embedder"):
# pyre-fixme[16]: Item `Tensor` of `Union[Tensor, Module]` has no
# attribute `embedder`.
return model.roi_heads.embedder
return None

Expand Down

0 comments on commit 2d6106b

Please sign in to comment.