renaming to return_intermediate_predictions

This commit is contained in:
Maximellerbach
2026-06-10 13:50:59 +02:00
committed by Maxime Ellerbach
parent 61bd244041
commit 992b0d9924
+9 -7
View File
@@ -94,7 +94,7 @@ def _build_card_context(
class ActionSelectKwargs(TypedDict, total=False): class ActionSelectKwargs(TypedDict, total=False):
noise: Tensor | None noise: Tensor | None
return_extra: bool return_intermediate_predictions: bool
class PreTrainedPolicy(nn.Module, HubMixin, abc.ABC): class PreTrainedPolicy(nn.Module, HubMixin, abc.ABC):
@@ -281,9 +281,10 @@ class PreTrainedPolicy(nn.Module, HubMixin, abc.ABC):
Child classes using action chunking should use this method within `select_action` to form the action chunk Child classes using action chunking should use this method within `select_action` to form the action chunk
cached for selection. cached for selection.
By default returns just the action `Tensor`. If `return_extra=True`, returns `(action, extra)` By default returns just the action `Tensor`. If `return_intermediate_predictions=True`,
where `extra` is a (possibly empty) `dict[str, Tensor]` of auxiliary outputs a policy may returns `(action, predictions)` where `predictions` is a (possibly empty) `dict[str, Tensor]`
expose (e.g. world-model predictions). Policies that produce nothing extra may ignore the kwarg. of additional model predictions a policy may expose (e.g. world-model predicted frames).
Policies that produce nothing extra may ignore the kwarg.
""" """
raise NotImplementedError raise NotImplementedError
@@ -296,9 +297,10 @@ class PreTrainedPolicy(nn.Module, HubMixin, abc.ABC):
When the model uses a history of observations, or outputs a sequence of actions, this method deals When the model uses a history of observations, or outputs a sequence of actions, this method deals
with caching. with caching.
By default returns just the action `Tensor`. If `return_extra=True`, returns `(action, extra)` By default returns just the action `Tensor`. If `return_intermediate_predictions=True`,
where `extra` is a (possibly empty) `dict[str, Tensor]` of auxiliary outputs a policy may returns `(action, predictions)` where `predictions` is a (possibly empty) `dict[str, Tensor]`
expose (e.g. world-model predictions). Policies that produce nothing extra may ignore the kwarg. of additional model predictions a policy may expose (e.g. world-model predicted frames).
Policies that produce nothing extra may ignore the kwarg.
""" """
raise NotImplementedError raise NotImplementedError