Skip to content
This repository has been archived by the owner on Oct 31, 2023. It is now read-only.

Change device_id -> device #66

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion rlpytorch/model_interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ def add_model(self, key, model, copy=False, cuda=False, gpu_id=None, opt=False,
self.models[key] = model.clone() if copy else model
if cuda:
if gpu_id is not None:
self.models[key].cuda(device_id=gpu_id)
self.models[key].cuda(device=gpu_id)
else:
self.models[key].cuda()

Expand Down
2 changes: 1 addition & 1 deletion rlpytorch/model_loader.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ def load_model(self, params):
sys.exit(1)

if args.gpu is not None and args.gpu >= 0:
model.cuda(device_id=args.gpu)
model.cuda(device=args.gpu)

return model

Expand Down