Rate this Page
★ ★ ★ ★ ★

TensorDictBase.__invert__#

TensorDictBase.__invert__() → Self#

Returns a new TensorDict instance with all tensors inverted (i.e., bitwise NOT operation).

Returns:

A new TensorDict instance with the same key set as the original, but with all tensors having their bits inverted.

Every tensordict class and every tensorclass has this method. For the other methods, see Methods by task.