Skip to content
Merged
Changes from all commits
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
18 changes: 8 additions & 10 deletions advanced_source/coding_ddpg.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,26 +58,24 @@
# Imports and setup
# -----------------
#
# .. code-block:: bash
#
# %%bash
# pip3 install torchrl mujoco glfw

import torchrl
import torch
import tqdm
from typing import Tuple

# sphinx_gallery_start_ignore
import warnings
from typing import Tuple

warnings.filterwarnings("ignore")
# sphinx_gallery_end_ignore

import torch.cuda
import tqdm

import torch.multiprocessing

###############################################################################
# We will execute the policy on CUDA if available
device = (
torch.device("cpu") if torch.cuda.device_count() == 0 else torch.device("cuda:0")
)
device = torch.device("cuda:0" if torch.cuda.is_available() else "cpu")
collector_device = torch.device("cpu") # Change the device to ``cuda`` to use CUDA

###############################################################################
Expand Down