Skip to content

Commit

Permalink
Merge pull request #54 from graphcore-research/awf/23a
Browse files Browse the repository at this point in the history
Update to PyTorch 2.2 addendum: Fixing a doc typo and logic mismatch
  • Loading branch information
thecharlieblake committed Apr 22, 2024
2 parents 2394ee4 + 484f9de commit f2ce856
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions unit_scaling/transforms/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ def torch_nn_modules_to_user_modules(mod: nn.Module) -> Any:
"""

for n, submod in mod.named_modules():
# Mirroring the check in https://github.com/pytorch/pytorch/blob/72662bf05b3499ce96aae9183a489c78f0c44c84/torch/_dynamo/variables/functions.py#L335 # noqa: E501
if submod.__module__.startswith("torch.nn."):
# Mirroring the check at https://github.com/pytorch/pytorch/blob/34bce27f0d12bf7226b37dfe365660aad456701a/torch/_dynamo/variables/nn_module.py#L307 # noqa: E501
if submod.__module__.startswith(("torch.nn.", "torch.ao.")):
# Generate a new name, so e.g. torch.nn.modules.sparse.Embedding
# becomes trivial_subclass_modules_sparse_Embedding
modulename = submod.__module__
Expand Down

0 comments on commit f2ce856

Please sign in to comment.