Skip to content

476 - 20200602 type hints part3 #480

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

Closed
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
4 changes: 2 additions & 2 deletions monai/networks/nets/densenet.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,9 +149,9 @@ def __init__(
# Avoid Built-in function isinstance was called with the wrong arguments warning
# pytype: disable=wrong-arg-types
for m in self.modules():
if isinstance(m, conv_type):
if isinstance(m, conv_type): # type: ignore
nn.init.kaiming_normal_(m.weight)
elif isinstance(m, norm_type):
elif isinstance(m, norm_type): # type: ignore
nn.init.constant_(m.weight, 1)
nn.init.constant_(m.bias, 0)
elif isinstance(m, nn.Linear):
Expand Down
4 changes: 3 additions & 1 deletion monai/transforms/spatial/array.py
Original file line number Diff line number Diff line change
Expand Up @@ -667,7 +667,9 @@ def __init__(
def randomize(self):
self._do_transform = self.R.random_sample() < self.prob
if hasattr(self.min_zoom, "__iter__"):
self._zoom = (self.R.uniform(l, h) for l, h in zip(self.min_zoom, self.max_zoom))
# TODO: Review the types here
# T484 Incompatible types in assignment (expression has type "Generator[Any, None, None]", variable has type "None")
self._zoom = (self.R.uniform(l, h) for l, h in zip(self.min_zoom, self.max_zoom)) # type: ignore
else:
self._zoom = self.R.uniform(self.min_zoom, self.max_zoom)

Expand Down
4 changes: 3 additions & 1 deletion monai/transforms/spatial/dictionary.py
Original file line number Diff line number Diff line change
Expand Up @@ -821,7 +821,9 @@ def __init__(
def randomize(self):
self._do_transform = self.R.random_sample() < self.prob
if hasattr(self.min_zoom, "__iter__"):
self._zoom = (self.R.uniform(l, h) for l, h in zip(self.min_zoom, self.max_zoom))
# TODO: Review the types here
# T484 Incompatible types in assignment (expression has type "Generator[Any, None, None]", variable has type "None")
self._zoom = (self.R.uniform(l, h) for l, h in zip(self.min_zoom, self.max_zoom)) # type: ignore
else:
self._zoom = self.R.uniform(self.min_zoom, self.max_zoom)

Expand Down