Skip to content

Commit

Permalink
directly set device index the first time to avoid initializing unused…
Browse files Browse the repository at this point in the history
… gpu (OpenNMT#1633)
  • Loading branch information
minhthuc2502 authored Mar 1, 2024
1 parent 63c1ae5 commit 1427722
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/models/model.cc
Original file line number Diff line number Diff line change
Expand Up @@ -423,7 +423,7 @@ namespace ctranslate2 {

{
// Check that the device and device index are valid.
ScopedDeviceSetter(device, device_index);
set_device_index(device, device_index);
}

std::unique_ptr<std::istream> model_file_ptr = model_reader.get_required_file(binary_file,
Expand Down

0 comments on commit 1427722

Please sign in to comment.