Shortcuts

consolidate_spec

class torchrl.data.consolidate_spec(spec: CompositeSpec, recurse_through_entries: bool = True, recurse_through_stack: bool = True)[source]

Given a TensorSpec, removes exclusive keys by adding 0 shaped specs.

Parameters:
  • spec (CompositeSpec) – the spec to be consolidated.

  • recurse_through_entries (bool) – if True, call the function recursively on all entries of the spec. Default is True.

  • recurse_through_stack (bool) – if True, if the provided spec is lazy, the function recursively on all specs in its list. Default is True.

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