Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update mypy version #524

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion dev-requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ black==22.12.0
flake8-bugbear==22.4.25
flake8==4.0.1
iopath
mypy==1.0.1
mypy==1.8.0
pep8-naming==0.12.1
pre-commit
pytest
Expand Down
6 changes: 3 additions & 3 deletions torchmultimodal/utils/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ def momentum_update(model: nn.Module, model_m: nn.Module, momentum: float) -> No

class ModelOutput(OrderedDict):
def keys(self) -> Any:
for field in fields(self):
for field in fields(self): # type: ignore
yield field.name

def __getitem__(self, key: Any) -> Any:
Expand All @@ -131,11 +131,11 @@ def __iter__(self) -> Any:
yield from self.keys()

def values(self) -> Any:
for field in fields(self):
for field in fields(self): # type: ignore
yield getattr(self, field.name)

def items(self) -> Any:
for field in fields(self):
for field in fields(self): # type: ignore
yield field.name, getattr(self, field.name)


Expand Down
Loading