Skip to content

Commit

Permalink
lint: appease mypy
Browse files Browse the repository at this point in the history
  • Loading branch information
XuehaiPan committed Oct 14, 2023
1 parent 5ca172a commit 239c033
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions torchopt/nn/stateless.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,8 @@ def recursive_setattr(path: str, value: torch.Tensor) -> torch.Tensor:
mod._parameters[attr] = value # type: ignore[assignment]
elif hasattr(mod, '_buffers') and attr in mod._buffers:
mod._buffers[attr] = value
elif hasattr(mod, '_meta_parameters') and attr in mod._meta_parameters: # type: ignore[operator]
mod._meta_parameters[attr] = value # type: ignore[operator,index]
elif hasattr(mod, '_meta_parameters') and attr in mod._meta_parameters:
mod._meta_parameters[attr] = value

Check warning on line 70 in torchopt/nn/stateless.py

View check run for this annotation

Codecov / codecov/patch

torchopt/nn/stateless.py#L69-L70

Added lines #L69 - L70 were not covered by tests
else:
setattr(mod, attr, value)
# pylint: enable=protected-access
Expand Down

0 comments on commit 239c033

Please sign in to comment.