MCPcopy Create free account
hub / github.com/microsoft/TRELLIS / __init__

Method __init__

trellis/modules/transformer/blocks.py:50–56  ·  view source on GitHub ↗
(self, channels: int, mlp_ratio: float = 4.0)

Source from the content-addressed store, hash-verified

48
49class FeedForwardNet(nn.Module):
50 def __init__(self, channels: int, mlp_ratio: float = 4.0):
51 super().__init__()
52 self.mlp = nn.Sequential(
53 nn.Linear(channels, int(channels * mlp_ratio)),
54 nn.GELU(approximate="tanh"),
55 nn.Linear(int(channels * mlp_ratio), channels),
56 )
57
58 def forward(self, x: torch.Tensor) -> torch.Tensor:
59 return self.mlp(x)

Callers 3

__init__Method · 0.45
__init__Method · 0.45
__init__Method · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected