Skip to content

Commit

Permalink
Fixed failing GPU test.
Browse files Browse the repository at this point in the history
  • Loading branch information
miguelalonsojr committed Oct 4, 2024
1 parent 4b8dbb4 commit 1eb9ce9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion ml-agents/mlagents/torch_utils/torch.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ def set_torch_config(torch_settings: TorchSettings) -> None:

if _device.type == "cuda":
torch.set_default_device(_device.type)
torch.set_default_dtype(torch.cuda.FloatTensor)
torch.set_default_dtype(torch.float32)
else:
torch.set_default_dtype(torch.float32)
logger.debug(f"default Torch device: {_device}")
Expand Down
4 changes: 2 additions & 2 deletions ml-agents/mlagents/trainers/tests/test_torch_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
"device_str, expected_type, expected_index, expected_tensor_type",
[
("cpu", "cpu", None, torch.float32),
("cuda", "cuda", None, torch.cuda.FloatTensor),
("cuda:42", "cuda", 42, torch.cuda.FloatTensor),
("cuda", "cuda", None, torch.float32),
("cuda:42", "cuda", 42, torch.float32),
("opengl", "opengl", None, torch.float32),
],
)
Expand Down

0 comments on commit 1eb9ce9

Please sign in to comment.