Shortcuts

ExcludeTransform

class torchrl.envs.transforms.ExcludeTransform(*excluded_keys)[source]

Excludes keys from the input tensordict.

Parameters:

*excluded_keys (iterable of NestedKey) – The name of the keys to exclude. If the key is not present, it is simply ignored.

forward(tensordict: TensorDictBase) TensorDictBase

Reads the input tensordict, and for the selected keys, applies the transform.

reset(tensordict: TensorDictBase) TensorDictBase[source]

Resets a tranform if it is stateful.

transform_observation_spec(observation_spec: TensorSpec) TensorSpec[source]

Transforms the observation spec such that the resulting spec matches transform mapping.

Parameters:

observation_spec (TensorSpec) – spec before the transform

Returns:

expected spec after the transform

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