def METHOD_NAME(self, x, name_list):
    x_orig = list(x[0:4])
    global_feat, visual_embeddings = x[4]
    B, C, H, W = visual_embeddings.shape
    if self.context_feature == 'attention':
        x1 = global_feat.reshape(B, C, 1)
        x2 = visual_embeddings.reshape(B, C, H * W)
        visual_context = torch.cat([x1, x2], dim=2).permute(0, 2, 1)
    texts = torch.cat([
        self.encode_text(c, context_length=self.context_length)
        for c in name_list
    ])
    x1 = texts.to(global_feat.device)
    x1 = self.text_encoder(x1, self.contexts)
    text_embeddings = x1.expand(B, -1, -1)
    # update text_embeddings by visual_context!
    # (B, 1, C)
    text_diff = self.context_decoder(text_embeddings, visual_context)
    # (B, K, C)
    text_embeddings = text_embeddings + self.gamma * text_diff
    # compute score map and concat
    B, K, C = text_embeddings.shape
    visual_embeddings = F.normalize(visual_embeddings, dim=1, p=2)
    text = F.normalize(text_embeddings, dim=2, p=2)
    score_map_list = []
    bsz = B
    for i in range(bsz):
        ind = 2 * i
        sub_text = torch.cat(
            [text[i:i + 1, ind:ind + 1], text[i:i + 1, ind + 1:ind + 2]],
            dim=1)  # 1 * 2 * h * w
        sub_score_map = torch.einsum('bchw,bkc->bkhw',
                                     visual_embeddings[i:i + 1],
                                     sub_text)  # 1 * 2 * h * w
        score_map_list.append(sub_score_map)
    score_map = torch.cat(score_map_list, dim=0)  # b * 2 * h * w
    x_orig[self.score_concat_index] = torch.cat(
        [x_orig[self.score_concat_index], score_map], dim=1)
    return x_orig, score_map