MCPcopy Create free account
hub / github.com/NJUNLP/GTS / forward

Method forward

code/BertModel/model.py:53–62  ·  view source on GitHub ↗
(self, tokens, masks)

Source from the content-addressed store, hash-verified

51 return logits_list
52
53 def forward(self, tokens, masks):
54 bert_feature, _ = self.bert(tokens, masks)
55 bert_feature = self.dropout_output(bert_feature)
56
57 bert_feature = bert_feature.unsqueeze(2).expand([-1, -1, self.args.max_sequence_len, -1])
58 bert_feature_T = bert_feature.transpose(1, 2)
59 features = torch.cat([bert_feature, bert_feature_T], dim=3)
60 logits = self.multi_hops(features, masks, self.args.nhops)
61
62 return logits[-1]

Callers

nothing calls this directly

Calls 1

multi_hopsMethod · 0.95

Tested by

no test coverage detected