fix: add torch::set_num_threads(4)

This commit is contained in:
fan-ziqi 2025-01-03 16:10:36 +08:00
parent f07083ba2e
commit da85366ac7
1 changed files with 1 additions and 0 deletions

View File

@ -32,6 +32,7 @@ RL_Sim::RL_Sim()
// init rl // init rl
torch::autograd::GradMode::set_enabled(false); torch::autograd::GradMode::set_enabled(false);
torch::set_num_threads(4);
if (this->params.observations_history.size() != 0) if (this->params.observations_history.size() != 0)
{ {
this->history_obs_buf = ObservationBuffer(1, this->params.num_observations, this->params.observations_history.size()); this->history_obs_buf = ObservationBuffer(1, this->params.num_observations, this->params.observations_history.size());