Shortcuts

TensorDictModuleWrapper

class tensordict.nn.TensorDictModuleWrapper(*args, **kwargs)

Wrapper class for TensorDictModule objects.

Once created, a TensorDictModuleWrapper will behave exactly as the TensorDictModule it contains except for the methods that are overwritten.

Parameters:

td_module (TensorDictModule) – operator to be wrapped.

forward(*args: Any, **kwargs: Any) TensorDictBase

Define the computation performed at every call.

Should be overridden by all subclasses.

Note

Although the recipe for forward pass needs to be defined within this function, one should call the Module instance afterwards instead of this since the former takes care of running the registered hooks while the latter silently ignores them.

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