Skip to content

Commit

Permalink
fix config
Browse files Browse the repository at this point in the history
Signed-off-by: Jinzhe Zeng <[email protected]>
  • Loading branch information
njzjz committed Nov 13, 2024
1 parent 39f357c commit cfff834
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions source/api_cc/src/DeepPotJAX.cc
Original file line number Diff line number Diff line change
Expand Up @@ -249,9 +249,9 @@ void deepmd::DeepPotJAX::init(const std::string& model,
double gpu_memory_fraction = 0.9;
auto bytes = reinterpret_cast<std::uint8_t*>(&gpu_memory_fraction);

// Put it to the config byte-array, from 3 to 10:
// Put it to the config byte-array, from 7 to 14:
for (std::size_t i = 0; i < sizeof(gpu_memory_fraction); ++i) {
config[i + 3] = bytes[i];
config[i + 7] = bytes[i];
}

TF_SetConfig(sessionopts, config.data(), config.size(), status);
Expand Down

0 comments on commit cfff834

Please sign in to comment.