You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The hasattr attempts to access the dist.mean attribute to assess its existence. If the dist.mean raises a NotImplementedError, then hasattr(dist,'mean') will raise a NotImplemented error. The subsequent try block is placed in the wrong spot to catch such an error.
Describe the bug
The following code section is logically flawed. Bug was introduced here
The hasattr attempts to access the dist.mean attribute to assess its existence. If the dist.mean raises a NotImplementedError, then hasattr(dist,'mean') will raise a NotImplemented error. The subsequent try block is placed in the wrong spot to catch such an error.
To Reproduce
Expected behavior
The code should correctly catch the NotImplementedError exception and then estimate the mean
Suggestion
System info
Python 3.10
torch==2.5.1+cu121
torchrl==0.6.0
tensordict==0.6.2
Checklist
The text was updated successfully, but these errors were encountered: