Rate this Page
★ ★ ★ ★ ★

TensorDictBase.__lt__#

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

Compares the tensordict with other leaf by leaf with <.

Works as __eq__(), except that an other of another type, such as None, gives False and a FutureWarning. Starting with TensorDict 0.17, the default will change to returning NotImplemented, so that Python raises a TypeError, as it does for tensors and for &.

Parameters:

other (TensorDictBase, dict, Tensor or Number) – the value to compare with.

Returns:

A new tensordict of boolean leaves, or False.

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