MCPcopy Create free account
hub / github.com/ali-vilab/ACE_plus / __init__

Method __init__

modules/layers.py:210–214  ·  view source on GitHub ↗
(self, dim: int, double: bool)

Source from the content-addressed store, hash-verified

208
209class Modulation(nn.Module):
210 def __init__(self, dim: int, double: bool):
211 super().__init__()
212 self.is_double = double
213 self.multiplier = 6 if double else 3
214 self.lin = nn.Linear(dim, self.multiplier * dim, bias=True)
215
216 def forward(self, vec: Tensor) -> tuple[ModulationOut, ModulationOut | None]:
217 out = self.lin(nn.functional.silu(vec))[:, None, :].chunk(self.multiplier, dim=-1)

Callers

nothing calls this directly

Calls 1

__init__Method · 0.45

Tested by

no test coverage detected