Skip to content

Commit

Permalink
add standalone module
Browse files Browse the repository at this point in the history
  • Loading branch information
haohuanw committed Jul 27, 2024
1 parent 66126fe commit d0a17fa
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions keras/src/backend/torch/layer.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,10 +140,8 @@ def _setattr_hook(self, name, value):
and all(isinstance(v, Layer) for v in value)
and len(value) > 0
):
warnings.warn(
"Torch backend currently cannot track list of "
"layers properly as an attribute."
)
for idx, v in enumerate(value):
self.add_module(f"{name}_{idx}", v)

return name, value

Expand Down

0 comments on commit d0a17fa

Please sign in to comment.