Skip to content

Commit

Permalink
Stop looking for Parameter inside AlfEnvironment
Browse files Browse the repository at this point in the history
  • Loading branch information
emailweixu committed Dec 13, 2024
1 parent d766257 commit 463803f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion alf/utils/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -1382,6 +1382,7 @@ def get_all_parameters(obj):
Returns:
list: list of (path, Parameters)
"""
from alf.environments.alf_environment import AlfEnvironment
all_parameters = []
memo = set()
unprocessed = [(obj, '')]
Expand All @@ -1395,7 +1396,7 @@ def get_all_parameters(obj):
if isinstance(obj, nn.Parameter):
all_parameters.append((path, obj))
continue
if isinstance(obj, torch.Tensor):
if isinstance(obj, (torch.Tensor, np.ndarray, AlfEnvironment)):
continue
if path:
path += '.'
Expand Down

0 comments on commit 463803f

Please sign in to comment.