Skip to content

Commit

Permalink
suppress mypy error (#66003)
Browse files Browse the repository at this point in the history
Summary: Pull Request resolved: #66003

Differential Revision:
D31340874
D31340874

Test Plan: Imported from OSS

Reviewed By: seemethere

Pulled By: suo

fbshipit-source-id: d9ef0f40625fe5ff21f8a5e044d5a75400367dc2
  • Loading branch information
suo authored and facebook-github-bot committed Oct 1, 2021
1 parent eac218d commit 21da6ae
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion torch/jit/_recursive.py
Expand Up @@ -131,7 +131,7 @@ def infer_concrete_type_builder(nn_module, share_types=True):
concrete_type_builder.set_module_list()

class_annotations = getattr(nn_module, '__annotations__', {})
if isinstance(nn_module, (torch.ao.quantization.QuantWrapper)):
if isinstance(nn_module, (torch.ao.quantization.QuantWrapper)): # type: ignore[attr-defined]
class_annotations = {}

# Get user-annotated ignored attributes.
Expand Down
4 changes: 2 additions & 2 deletions torch/utils/data/dataloader.py
Expand Up @@ -271,11 +271,11 @@ def __init__(self, dataset: Dataset[T_co], batch_size: Optional[int] = 1,

if batch_size is not None and batch_sampler is None:
# auto_collation without custom batch_sampler
batch_sampler = BatchSampler(sampler, batch_size, drop_last)
batch_sampler = BatchSampler(sampler, batch_size, drop_last) # type: ignore[arg-type]

self.batch_size = batch_size
self.drop_last = drop_last
self.sampler = sampler
self.sampler = sampler # type: ignore[assignment]
self.batch_sampler = batch_sampler
self.generator = generator

Expand Down

0 comments on commit 21da6ae

Please sign in to comment.