MCPcopy Create free account
hub / github.com/huggingface/diffusers / FP32SiLU

Class FP32SiLU

src/diffusers/models/activations.py:53–62  ·  view source on GitHub ↗

r""" SiLU activation function with input upcasted to torch.float32.

Source from the content-addressed store, hash-verified

51
52
53class FP32SiLU(nn.Module):
54 r"""
55 SiLU activation function with input upcasted to torch.float32.
56 """
57
58 def __init__(self):
59 super().__init__()
60
61 def forward(self, inputs: torch.Tensor) -> torch.Tensor:
62 return F.silu(inputs.float(), inplace=False).to(inputs.dtype)
63
64
65class GELU(nn.Module):

Callers 2

__init__Method · 0.85
__init__Method · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…