vwxyzjn / cleanrl

High-quality single file implementation of Deep Reinforcement Learning algorithms with research-friendly features (PPO, DQN, C51, DDPG, TD3, SAC, PPG)
http://docs.cleanrl.dev
Other
5.26k stars 602 forks source link

Depreciate legacy constructor so that cuda can be used #302

Closed WillDudley closed 1 year ago

WillDudley commented 1 year ago

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

Checklist:

vercel[bot] commented 1 year ago

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)
vwxyzjn commented 1 year ago

Thanks @WillDudley !