Shortcuts

TanhGate

class torchtune.modules.TanhGate[source]

Implements a basic learnable gate to scale layer outputs

forward(x: Tensor) Tensor[source]
Parameters:

x (torch.Tensor) – input tensor to gate

Returns:

The output tensor after gating. Has the same shape as x.

Return type:

torch.Tensor

Docs

Access comprehensive developer documentation for PyTorch

View Docs

Tutorials

Get in-depth tutorials for beginners and advanced developers

View Tutorials

Resources

Find development resources and get your questions answered

View Resources