mirror of
https://github.com/huggingface/lerobot.git
synced 2026-07-24 02:06:15 +00:00
add torch.no_grad decorators
This commit is contained in:
@@ -760,6 +760,7 @@ class MultiTaskDiTPolicy(PreTrainedPolicy):
|
|||||||
|
|
||||||
self._queues["task"] = deque(maxlen=self.config.n_obs_steps)
|
self._queues["task"] = deque(maxlen=self.config.n_obs_steps)
|
||||||
|
|
||||||
|
@torch.no_grad()
|
||||||
def predict_action_chunk(self, batch: dict[str, Tensor]) -> Tensor:
|
def predict_action_chunk(self, batch: dict[str, Tensor]) -> Tensor:
|
||||||
"""Predict a chunk of actions given environment observations"""
|
"""Predict a chunk of actions given environment observations"""
|
||||||
self.eval()
|
self.eval()
|
||||||
@@ -778,6 +779,7 @@ class MultiTaskDiTPolicy(PreTrainedPolicy):
|
|||||||
actions = self._generate_actions(batch)
|
actions = self._generate_actions(batch)
|
||||||
return actions
|
return actions
|
||||||
|
|
||||||
|
@torch.no_grad()
|
||||||
def select_action(self, batch: dict[str, Tensor]) -> Tensor:
|
def select_action(self, batch: dict[str, Tensor]) -> Tensor:
|
||||||
"""Select a single action given environment observations"""
|
"""Select a single action given environment observations"""
|
||||||
if ACTION in batch:
|
if ACTION in batch:
|
||||||
|
|||||||
Reference in New Issue
Block a user