We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
to
When calling to on a MultiDiscreteTensorSpec, it fails with TypeError: MultiDiscreteTensorSpec.__init__() got an unexpected keyword argument 'n'
TypeError: MultiDiscreteTensorSpec.__init__() got an unexpected keyword argument 'n'
Steps to reproduce the behavior.
import torchrl actions=MultiDiscreteTensorSpec(nvec=[2]) actions.to(dest="cuda:0")
Traceback (most recent call last): File "<input>", line 1, in <module> File "../python3.10/site-packages/torchrl/data/tensor_specs.py", line 3212, in to return self.__class__( TypeError: MultiDiscreteTensorSpec.__init__() got an unexpected keyword argument 'n'
The MultiDiscreteTensorSpec should be sent to device cuda:0.
cuda:0
import torchrl, numpy, sys print(torchrl.__version__, numpy.__version__, sys.version, sys.platform) 0.4.0 1.26.4 3.10.12 (main, Nov 20 2023, 15:14:05) [GCC 11.4.0] linux
Changing to nvec here fixes the issue.
nvec
return self.__class__( nvec=self.nvec.to(dest), shape=None, device=dest_device, dtype=dest_dtype, mask=mask, )
The text was updated successfully, but these errors were encountered:
vmoens
Successfully merging a pull request may close this issue.
Describe the bug
When calling
to
on a MultiDiscreteTensorSpec, it fails withTypeError: MultiDiscreteTensorSpec.__init__() got an unexpected keyword argument 'n'
To Reproduce
Steps to reproduce the behavior.
Expected behavior
The MultiDiscreteTensorSpec should be sent to device
cuda:0
.System info
Reason and Possible fixes
Changing to
nvec
here fixes the issue.Checklist
The text was updated successfully, but these errors were encountered: