Skip to content

Commit 8257799

Browse files
valterschutzValter Schutz
andauthored
[Doc] actor docstrings (#2626)
Co-authored-by: Valter Schutz <valterschutz@proton.me>
1 parent b2e9f29 commit 8257799

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

torchrl/modules/tensordict_module/actors.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -153,14 +153,14 @@ class ProbabilisticActor(SafeProbabilisticTensorDictSequential):
153153
issues. If this value is out of bounds, it is projected back onto the
154154
desired space using the :obj:`TensorSpec.project`
155155
method. Default is ``False``.
156-
default_interaction_type (str, optional): keyword-only argument.
156+
default_interaction_type (tensordict.nn.InteractionType, optional): keyword-only argument.
157157
Default method to be used to retrieve
158-
the output value. Should be one of: 'InteractionType.MODE', 'InteractionType.DETERMINISTIC',
159-
'InteractionType.MEDIAN', 'InteractionType.MEAN' or
160-
'InteractionType.RANDOM' (in which case the value is sampled
158+
the output value. Should be one of: ``InteractionType.MODE``, ``InteractionType.DETERMINISTIC``,
159+
``InteractionType.MEDIAN``, ``InteractionType.MEAN`` or
160+
``InteractionType.RANDOM`` (in which case the value is sampled
161161
randomly from the distribution).
162162
TorchRL's ``ExplorationType`` class is a proxy to ``InteractionType``.
163-
Defaults to is 'InteractionType.DETERMINISTIC'.
163+
Defaults to ``InteractionType.DETERMINISTIC``.
164164
165165
.. note:: When a sample is drawn, the :class:`ProbabilisticActor` instance will
166166
first look for the interaction mode dictated by the

torchrl/modules/tensordict_module/probabilistic.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -68,12 +68,12 @@ class SafeProbabilisticModule(ProbabilisticTensorDictModule):
6868
returned by the input module. If the sample is out of bounds, it is
6969
projected back onto the desired space using the `TensorSpec.project` method.
7070
Default is ``False``.
71-
default_interaction_type (str, optional): default method to be used to retrieve
72-
the output value. Should be one of: 'mode', 'median', 'mean' or 'random'
71+
default_interaction_type (tensordict.nn.InteractionType, optional): default method to be used to retrieve
72+
the output value. Should be one of: ``InteractionType.MODE``, ``InteractionType.MEDIAN``, ``InteractionType.MEAN`` or ``InteractionType.RANDOM``
7373
(in which case the value is sampled randomly from the distribution). Default
74-
is 'mode'.
74+
is ``InteractionType.MODE``.
7575
Note: When a sample is drawn, the :obj:`ProbabilisticTDModule` instance will
76-
fist look for the interaction mode dictated by the `interaction_typ()`
76+
fist look for the interaction mode dictated by the `interaction_type()`
7777
global function. If this returns `None` (its default value), then the
7878
`default_interaction_type` of the :class:`~.ProbabilisticTDModule`
7979
instance will be used. Note that DataCollector instances will use

0 commit comments

Comments
 (0)