Fabrice-TIERCELIN commited on
Commit
0b24ac6
·
verified ·
1 Parent(s): eb92d4b

self_attn_mask_1 = attention_mask.view(batch_size, 1, 1, seq_len).expand(-1, -1, seq_len, -1)

Browse files
diffusers_helper/models/hunyuan_video_packed.py CHANGED
@@ -358,7 +358,7 @@ class HunyuanVideoIndividualTokenRefiner(nn.Module):
358
  batch_size = attention_mask.shape[0]
359
  seq_len = attention_mask.shape[1]
360
  attention_mask = attention_mask.to(hidden_states.device).bool()
361
- self_attn_mask_1 = attention_mask.view(batch_size, 1, 1, seq_len).repeat(1, 1, seq_len, 1)
362
  self_attn_mask_2 = self_attn_mask_1.transpose(2, 3)
363
  self_attn_mask = (self_attn_mask_1 & self_attn_mask_2).bool()
364
  self_attn_mask[:, :, :, 0] = True
 
358
  batch_size = attention_mask.shape[0]
359
  seq_len = attention_mask.shape[1]
360
  attention_mask = attention_mask.to(hidden_states.device).bool()
361
+ self_attn_mask_1 = attention_mask.view(batch_size, 1, 1, seq_len).expand(-1, -1, seq_len, -1)
362
  self_attn_mask_2 = self_attn_mask_1.transpose(2, 3)
363
  self_attn_mask = (self_attn_mask_1 & self_attn_mask_2).bool()
364
  self_attn_mask[:, :, :, 0] = True