Skip to content

Depreciate legacy constructor so that cuda can be used#302

Merged
vwxyzjn merged 3 commits intovwxyzjn:masterfrom
WillDudley:patch-1
Oct 31, 2022
Merged

Depreciate legacy constructor so that cuda can be used#302
vwxyzjn merged 3 commits intovwxyzjn:masterfrom
WillDudley:patch-1

Conversation

@WillDudley
Copy link
Copy Markdown
Contributor

@WillDudley WillDudley commented Oct 24, 2022

Here's an error I got when running this code on cuda:

>>> import torch
>>> torch.FloatTensor((1 - 0) / 2.0, device="cuda:0")
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
RuntimeError: legacy constructor expects device type: cpu but device type: cuda was passed

Types of changes

  • Bug fix
  • New feature
  • New algorithm
  • Documentation

Checklist:

  • I've read the CONTRIBUTION guide (required).
  • I have ensured pre-commit run --all-files passes (required).
  • I have updated the documentation and previewed the changes via mkdocs serve.
  • I have updated the tests accordingly (if applicable).

Here's an error I got when running this code on cuda:
```
>>> import torch
>>> torch.FloatTensor((1 - 0) / 2.0, device="cuda:0")
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
RuntimeError: legacy constructor expects device type: cpu but device type: cuda was passed
```
@vercel
Copy link
Copy Markdown

vercel bot commented Oct 24, 2022

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated
cleanrl ✅ Ready (Inspect) Visit Preview Oct 31, 2022 at 2:32PM (UTC)

@WillDudley WillDudley mentioned this pull request Oct 24, 2022
@vwxyzjn vwxyzjn marked this pull request as ready for review October 31, 2022 14:26
@vwxyzjn
Copy link
Copy Markdown
Owner

vwxyzjn commented Oct 31, 2022

Thanks @WillDudley !

@vwxyzjn vwxyzjn merged commit 33bb39c into vwxyzjn:master Oct 31, 2022
ludgerpaehler pushed a commit to ludgerpaehler/koopman-rl that referenced this pull request Jan 13, 2026
* Depreciate legacy constructor so that cuda can be used

Here's an error I got when running this code on cuda:
```
>>> import torch
>>> torch.FloatTensor((1 - 0) / 2.0, device="cuda:0")
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
RuntimeError: legacy constructor expects device type: cpu but device type: cuda was passed
```

* quick fix

* Fix TD3 and ddpg

Co-authored-by: Costa Huang <costa.huang@outlook.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants