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

Method forward

modules/layers.py:216–222  ·  view source on GitHub ↗
(self, vec: Tensor)

Source from the content-addressed store, hash-verified

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)
218
219 return (
220 ModulationOut(*out[:3]),
221 ModulationOut(*out[3:]) if self.is_double else None,
222 )
223
224
225class DoubleStreamBlock(nn.Module):

Callers

nothing calls this directly

Calls 1

ModulationOutClass · 0.85

Tested by

no test coverage detected