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

Method forward

modules/layers.py:502–506  ·  view source on GitHub ↗
(self, x: Tensor, vec: Tensor)

Source from the content-addressed store, hash-verified

500 self.adaLN_modulation = nn.Sequential(nn.SiLU(), nn.Linear(hidden_size, 2 * hidden_size, bias=True))
501
502 def forward(self, x: Tensor, vec: Tensor) -> Tensor:
503 shift, scale = self.adaLN_modulation(vec).chunk(2, dim=1)
504 x = (1 + scale[:, None, :]) * self.norm_final(x) + shift[:, None, :]
505 x = self.linear(x)
506 return x
507
508
509if __name__ == '__main__':

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected