MCPcopy Create free account
hub / github.com/OpenImagingLab/FlashVSR / attention_mask

Method attention_mask

diffsynth/models/sd_text_encoder.py:58–62  ·  view source on GitHub ↗
(self, length)

Source from the content-addressed store, hash-verified

56 self.final_layer_norm = torch.nn.LayerNorm(embed_dim)
57
58 def attention_mask(self, length):
59 mask = torch.empty(length, length)
60 mask.fill_(float("-inf"))
61 mask.triu_(1)
62 return mask
63
64 def forward(self, input_ids, clip_skip=1):
65 embeds = self.token_embedding(input_ids) + self.position_embeds

Callers 1

__init__Method · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected