Skip to content

Commit 2486c58

Browse files
committed
Cleanup
1 parent 87d6c9c commit 2486c58

File tree

2 files changed

+0
-5
lines changed

2 files changed

+0
-5
lines changed

ml-agents/mlagents/trainers/policy/torch_policy.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,6 @@ def evaluate(
109109
if "log_probs" in run_out:
110110
run_out["log_probs"] = run_out["log_probs"].to_log_probs_tuple()
111111
if "entropy" in run_out:
112-
# Ensure entropy is detached and moved to CPU before NumPy conversion
113112
run_out["entropy"] = ModelUtils.to_numpy(run_out["entropy"])
114113
if self.use_recurrent:
115114
run_out["memory_out"] = ModelUtils.to_numpy(memories).squeeze(0)

ml-agents/mlagents/trainers/trainer_controller.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@
2828
from mlagents.trainers.behavior_id_utils import BehaviorIdentifiers
2929
from mlagents.trainers.agent_processor import AgentManager
3030
from mlagents import torch_utils
31-
from mlagents.trainers.settings import TorchSettings
3231
from mlagents.torch_utils.globals import get_rank
3332

3433

@@ -293,9 +292,6 @@ def join_threads(self, timeout_seconds: float = 1.0) -> None:
293292
merge_gauges(thread_timer_stack.gauges)
294293

295294
def trainer_update_func(self, trainer: Trainer) -> None:
296-
# Note: Avoid calling torch.set_default_device in worker threads; it can
297-
# interfere with PyTorch's global device context manager. The policy and
298-
# optimizer code explicitly places tensors on the configured default_device().
299295
while not self.kill_trainers:
300296
with hierarchical_timer("trainer_advance"):
301297
trainer.advance()

0 commit comments

Comments
 (0)