MCPcopy Create free account
hub / github.com/ROCm/AMDMIGraphX / __init__

Method __init__

examples/diffusion/python_stable_diffusion_3/other_impls.py:47–54  ·  view source on GitHub ↗
(self, in_features, hidden_features=None, out_features=None, act_layer=nn.GELU, bias=True, dtype=None, device=None)

Source from the content-addressed store, hash-verified

45class Mlp(nn.Module):
46 """ MLP as used in Vision Transformer, MLP-Mixer and related networks"""
47 def __init__(self, in_features, hidden_features=None, out_features=None, act_layer=nn.GELU, bias=True, dtype=None, device=None):
48 super().__init__()
49 out_features = out_features or in_features
50 hidden_features = hidden_features or in_features
51
52 self.fc1 = nn.Linear(in_features, hidden_features, bias=bias, dtype=dtype, device=device)
53 self.act = act_layer
54 self.fc2 = nn.Linear(hidden_features, out_features, bias=bias, dtype=dtype, device=device)
55
56 def forward(self, x):
57 x = self.fc1(x)

Callers

nothing calls this directly

Calls 1

__init__Method · 0.45

Tested by

no test coverage detected