Skip to content

Commit

Permalink
Update set_global_device parameter in initialize_torch_settings function
Browse files Browse the repository at this point in the history
  • Loading branch information
RichieHakim committed Apr 6, 2024
1 parent c35e261 commit 7f2a0aa
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions bnpm/torch_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ def initialize_torch_settings(
enable_cudnn: Optional[bool] = None,
deterministic_cudnn: Optional[bool] = None,
deterministic_torch: Optional[bool] = None,
set_global_device: Union[str, torch.device, bool] = False,
set_global_device: Optional[str, torch.device] = None,
init_linalg: bool = True,
init_linalg_device: Union[str, torch.device] = 'cuda:0',
) -> None:
Expand Down Expand Up @@ -266,7 +266,7 @@ def initialize_torch_settings(
torch.backends.cudnn.deterministic = False
if deterministic_torch:
torch.set_deterministic(False)
if set_global_device is not False:
if set_global_device is not None:
torch.cuda.set_device(set_global_device)

## Initialize linalg libarary
Expand Down

0 comments on commit 7f2a0aa

Please sign in to comment.