Shortcuts

as_nested_tensor

class torchrl.envs.llm.transforms.as_nested_tensor(list_of_tensordicts: list[tensordict.base.TensorDictBase])[source]

Stacks a list of tensordicts into a single tensordict with nested tensors.

Parameters:

list_of_tensordicts (list[TensorDictBase]) – A list of tensordicts to stack.

Returns:

A tensordict with nested tensors.

Return type:

TensorDictBase

Docs

Access comprehensive developer documentation for PyTorch

View Docs

Tutorials

Get in-depth tutorials for beginners and advanced developers

View Tutorials

Resources

Find development resources and get your questions answered

View Resources