Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BugFix] Fix CompositeSpec.to_numpy method #931

Merged
merged 7 commits into from
Feb 21, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Replace _to_numpy by to_numpy
  • Loading branch information
riiswa committed Feb 21, 2023
commit 97ddd1ad16bedf790bff6637deaab9eea8a49414
2 changes: 1 addition & 1 deletion torchrl/data/tensor_specs.py
Original file line number Diff line number Diff line change
Expand Up @@ -1947,7 +1947,7 @@ def clone(self) -> CompositeSpec:
)

def to_numpy(self, val: TensorDict, safe: bool = True) -> dict:
return {key: self[key]._to_numpy(val) for key, val in val.items()}
return {key: self[key].to_numpy(val) for key, val in val.items()}

def zero(self, shape=None) -> TensorDictBase:
if shape is None:
Expand Down