Rate this Page
★ ★ ★ ★ ★

TensorDictBase.__eq__#

TensorDictBase.__eq__(other: Any) → Self | bool#

Compares two tensordicts against each other, for every key. The two tensordicts must have the same key set.

Returns:

a new TensorDict instance with all tensors are boolean tensors of the same shape as the original tensors.

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