MCPcopy Create free account
hub / github.com/Francis-Rings/FlashPortrait / forward

Method forward

wan/models/wan_text_encoder.py:291–304  ·  view source on GitHub ↗
(
        self, 
        input_ids: Optional[torch.LongTensor] = None,
        attention_mask: Optional[torch.FloatTensor] = None,
    )

Source from the content-addressed store, hash-verified

289 self.apply(init_weights)
290
291 def forward(
292 self,
293 input_ids: Optional[torch.LongTensor] = None,
294 attention_mask: Optional[torch.FloatTensor] = None,
295 ):
296 x = self.token_embedding(input_ids)
297 x = self.dropout(x)
298 e = self.pos_embedding(x.size(1),
299 x.size(1)) if self.shared_pos else None
300 for block in self.blocks:
301 x = block(x, attention_mask, pos_bias=e)
302 x = self.norm(x)
303 x = self.dropout(x)
304 return (x, )
305
306 @classmethod
307 def from_pretrained(cls, pretrained_model_path, additional_kwargs={}, low_cpu_mem_usage=False, torch_dtype=torch.bfloat16):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected