Rate this Page
★ ★ ★ ★ ★

TensorDictBase.__iter__#

TensorDictBase.__iter__() → Iterator[TensorDictBase]#

Iterates over the first batch dimension of the tensordict.

Raises:

TypeError – if the tensordict has no batch dimensions, as iter() does for a 0-d tensor.

Every tensordict class and every tensorclass has this method. For the other methods, see Methods by task.