Skip to content

Commit

Permalink
fix bug
Browse files Browse the repository at this point in the history
  • Loading branch information
hhaAndroid committed Jan 9, 2024
1 parent dbf0bc4 commit 6db3637
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions mmdet/models/layers/transformer/grounding_dino_layers.py
Original file line number Diff line number Diff line change
Expand Up @@ -238,17 +238,17 @@ def forward(self,
layer_id].self_attn_cfg.num_heads
if text_self_attention_masks is None:
# rec
key_padding_mask = text_attention_mask
l_key_padding_mask = text_attention_mask
else:
# phrase grounding
key_padding_mask = None
l_key_padding_mask = None
memory_text = self.text_layers[layer_id](
query=memory_text,
query_pos=(pos_text if pos_text is not None else None),
attn_mask=~text_self_attention_masks.repeat(
text_num_heads, 1, 1) if text_self_attention_masks is not None else None,
# note we use ~ for mask here
key_padding_mask=key_padding_mask,
key_padding_mask=l_key_padding_mask,
)
output = layer(
query=output,
Expand Down

0 comments on commit 6db3637

Please sign in to comment.