MCPcopy Create free account
hub / github.com/AMAP-ML/EMF / forward

Method forward

sana_transformer.py:90–96  ·  view source on GitHub ↗
(
        self, hidden_states: torch.Tensor, temb: torch.Tensor, scale_shift_table: torch.Tensor
    )

Source from the content-addressed store, hash-verified

88 self.norm = nn.LayerNorm(dim, elementwise_affine=elementwise_affine, eps=eps)
89
90 def forward(
91 self, hidden_states: torch.Tensor, temb: torch.Tensor, scale_shift_table: torch.Tensor
92 ) -> torch.Tensor:
93 hidden_states = self.norm(hidden_states)
94 shift, scale = (scale_shift_table[None] + temb[:, None].to(scale_shift_table.device)).chunk(2, dim=1)
95 hidden_states = hidden_states * (1 + scale) + shift
96 return hidden_states
97
98
99class SanaCombinedTimestepGuidanceEmbeddings(nn.Module):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected