chore: replace hard-coded action values with constants throughout all the source code (#2055)

* chore: replace hard-coded 'action' values with constants throughout all the source code

* chore(tests): replace hard-coded action values with constants throughout all the test code
This commit is contained in:
Steven Palma
2025-09-26 13:33:18 +02:00
committed by GitHub
parent 9627765ce2
commit d2782cf66b
47 changed files with 269 additions and 255 deletions
+3 -1
View File
@@ -18,6 +18,8 @@ from typing import TypedDict
import torch
from lerobot.utils.constants import ACTION
class Transition(TypedDict):
state: dict[str, torch.Tensor]
@@ -39,7 +41,7 @@ def move_transition_to_device(transition: Transition, device: str = "cpu") -> Tr
}
# Move action to device
transition["action"] = transition["action"].to(device, non_blocking=non_blocking)
transition[ACTION] = transition[ACTION].to(device, non_blocking=non_blocking)
# Move reward and done if they are tensors
if isinstance(transition["reward"], torch.Tensor):