ee9cadefd8d3b96469f97453db73a117fee5a009,mmf/models/vilbert.py,BertBiAttention,forward,#BertBiAttention#,330

Before Change


        // attention_scores2 = attention_scores2 + co_attention_mask

        // Normalize the attention scores to probabilities.
        attention_probs2 = nn.Softmax(dim=-1)(attention_scores2)

        // This is actually dropping out entire tokens to attend to, which might
        // seem a bit unusual, but is taken from the original Transformer paper.
        attention_probs2 = self.dropout2(attention_probs2)

After Change


        // attention_scores2 = attention_scores2 + co_attention_mask

        // Normalize the attention scores to probabilities.
        attention_probs2 = nn.functional.softmax(attention_scores2, dim=-1)

        // This is actually dropping out entire tokens to attend to, which might
        // seem a bit unusual, but is taken from the original Transformer paper.
        attention_probs2 = self.dropout2(attention_probs2)
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 4

Instances


Project Name: facebookresearch/pythia
Commit Name: ee9cadefd8d3b96469f97453db73a117fee5a009
Time: 2020-10-14
Author: mengq@fb.com
File Name: mmf/models/vilbert.py
Class Name: BertBiAttention
Method Name: forward


Project Name: facebookresearch/pythia
Commit Name: ee9cadefd8d3b96469f97453db73a117fee5a009
Time: 2020-10-14
Author: mengq@fb.com
File Name: mmf/models/vilbert.py
Class Name: BertSelfAttention
Method Name: forward


Project Name: facebookresearch/pythia
Commit Name: ee9cadefd8d3b96469f97453db73a117fee5a009
Time: 2020-10-14
Author: mengq@fb.com
File Name: mmf/models/vilbert.py
Class Name: BertImageSelfAttention
Method Name: forward