Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit c9fff7f

Browse files
committed
Fix CI
1 parent 09b9511 commit c9fff7f

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

keras/backend/torch/core.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,11 +70,10 @@ def _parse_device_input(device_name):
7070
device_name = device_name.lower()
7171
if "gpu" in device_name:
7272
device_name = device_name.replace("gpu", "cuda")
73-
torch_device = torch.device(device_name)
74-
elif not isinstance(device_name, torch.device):
73+
else:
7574
raise ValueError(
7675
"Invalid value for argument `device_name`. "
77-
"Expected a string like 'gpu:0' or a `torch.device` instance. "
76+
"Expected a string like 'gpu:0' or 'cpu'. "
7877
f"Received: device_name='{device_name}'"
7978
)
8079
# The torch.Device instance can be used directly.

0 commit comments

Comments
 (0)