Shortcuts

fromkeys

class tensordict.fromkeys(keys: List[NestedKey], value: Any = 0)

Creates a tensordict from a list of keys and a single value.

Parameters:
  • keys (list of NestedKey) – An iterable specifying the keys of the new dictionary.

  • value (compatible type, optional) – The value for all keys. Defaults to 0.

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