Skip to content

Commit

Permalink
lint: appease mypy
Browse files Browse the repository at this point in the history
  • Loading branch information
XuehaiPan committed Nov 7, 2023
1 parent 663b62a commit 712b5e5
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
else:
setattr(mod, attr, value)
# pylint: enable=protected-access
Expand Down

0 comments on commit 712b5e5

Please sign in to comment.