Rate this Page

torch.foreach.tanh_#

torch.foreach.tanh_(inputs: TensorList, /) tuple[Tensor, ...] | list[Tensor][source]#

Applies torch.tanh() to each tensor in inputs in-place.

This is semantically equivalent to applying torch.tanh() independently at every list position. Mutates every tensor in inputs and returns the exact input container object.

Tensor-list arguments must be non-empty. An accelerated multi-tensor implementation is used only when supported by the inputs; otherwise the operation falls back to per-tensor execution.

Parameters:

inputs (list or tuple of Tensor) – tensors to transform.

Returns:

the exact input list or tuple.