mirror of
https://github.com/wassname/DeepRL.git
synced 2026-10-29 12:40:58 +08:00
Refactor DDPG
This commit is contained in:
1 parent
ceea0a474b
commit
2eefb04b9d
2 files changed
+4
-7
No files matched your search
@@ -18,6 +18,8 @@ class BaseNet:
|
||||
self.to(self.device)
|
||||
|
||||
def tensor(self, x):
|
||||
if isinstance(x, torch.Tensor):
|
||||
return x
|
||||
x = torch.tensor(x, device=self.device, dtype=torch.float32)
|
||||
return x
|
||||
|
||||
|
||||
Reference in new issue
Block a user