Skip to content

Commit

Permalink
Update on "Add non-recursive module.to_empty option"
Browse files Browse the repository at this point in the history
Fixes #97049, related to #104187




[ghstack-poisoned]
  • Loading branch information
mikaylagawarecki committed Jun 26, 2023
1 parent 081d339 commit a0116cd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion torch/nn/cpp.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ def __init__(self, cpp_module):
if not attr.startswith("_"):
setattr(self, attr, getattr(self.cpp_module, attr))

def _apply(self, fn):
def _apply(self, fn, recurse=True):
for param in self.parameters():
# Tensors stored in modules are graph leaves, and we don't
# want to create copy nodes, so we have to unpack the data.
Expand Down

0 comments on commit a0116cd

Please sign in to comment.