Skip to content

Commit 444cf6b

Browse files
committed
Interpret REACTANT_DEFAULT_DEVICE as 0-based
1 parent 2c169ef commit 444cf6b

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/xla/Client.jl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ function platform_name end
1515

1616
function default_device(client::AbstractClient)
1717
return addressable_devices(client)[something(
18-
tryparse(Int, get(ENV, "REACTANT_DEFAULT_DEVICE", "1")), 1
18+
# `REACTANT_DEFAULT_DEVICE` is interpreted as 0-based.
19+
tryparse(Int, get(ENV, "REACTANT_DEFAULT_DEVICE", "0")) + 1, 1
1920
)]
2021
end

0 commit comments

Comments
 (0)