MCPcopy Create free account
hub / github.com/aigc3d/LHM / forward

Method forward

LHM/models/block.py:116–124  ·  view source on GitHub ↗
(self, x, cond, mod)

Source from the content-addressed store, hash-verified

114 )
115
116 def forward(self, x, cond, mod):
117 # x: [N, L, D]
118 # cond: [N, L_cond, D_cond]
119 # mod: [N, D_mod]
120 x = x + self.cross_attn(self.norm1(x, mod), cond, cond, need_weights=False)[0]
121 before_sa = self.norm2(x, mod)
122 x = x + self.self_attn(before_sa, before_sa, before_sa, need_weights=False)[0]
123 x = x + self.mlp(self.norm3(x, mod))
124 return x

Callers

nothing calls this directly

Calls 3

norm1Method · 0.45
norm2Method · 0.45
norm3Method · 0.45

Tested by

no test coverage detected