Skip to content

Commit c671e85

Browse files
authored
[Doc] Add tuto and time dim info in docs (#1130)
1 parent 99a95e3 commit c671e85

File tree

3 files changed

+5
-1
lines changed

3 files changed

+5
-1
lines changed

docs/source/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ Intermediate
4949
tutorials/torchrl_envs
5050
tutorials/pretrained_models
5151
tutorials/dqn_with_rnn
52+
tutorials/rb_tutorial
5253

5354
Advanced
5455
--------

docs/source/reference/envs.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,9 @@ With these, the following methods are implemented:
6363
a maximum number of steps (``max_steps=N``) and using a policy (``policy=model``).
6464
The policy should be coded using a :class:`tensordict.nn.TensorDictModule`
6565
(or any other :class:`tensordict.TensorDict`-compatible module).
66+
The resulting :class:`tensordict.TensorDict` instance will be marked with
67+
a trailing ``"time"`` named dimension that can be used by other modules
68+
to treat this batched dimension as it should.
6669

6770
The following figure summarizes how a rollout is executed in torchrl.
6871

tutorials/sphinx-tutorials/rb_tutorial.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -491,7 +491,7 @@ class MyData:
491491
# sampled items:
492492
#
493493
sample = rb.sample()
494-
sample["td_error"] = (data.numel() - sample["index"]).exp()
494+
sample["td_error"] = data.numel() - sample["index"]
495495
rb.update_tensordict_priority(sample)
496496

497497
######################################################################

0 commit comments

Comments
 (0)