Rate this Page
★ ★ ★ ★ ★

TensorDictBase.complex32#

TensorDictBase.complex32(*, cast_filter: Callable | None = None) → Self#

Returns a tensordict whose tensor leaves are cast to torch.complex32.

Keyword Arguments:

cast_filter (Callable, optional) – a predicate fn(key, value) -> bool that selects the tensor leaves to cast, as in to(). Defaults to None, which casts every tensor leaf (a tensorclass uses its own cast_filter, if it declares one).

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