(self, args)
| 6 | |
| 7 | class MultiInferBert(torch.nn.Module): |
| 8 | def __init__(self, args): |
| 9 | super(MultiInferBert, self).__init__() |
| 10 | |
| 11 | self.args = args |
| 12 | self.bert = BertModel.from_pretrained(args.bert_model_path) |
| 13 | self.tokenizer = BertTokenizer.from_pretrained(args.bert_tokenizer_path) |
| 14 | |
| 15 | self.cls_linear = torch.nn.Linear(args.bert_feature_dim*2, args.class_num) |
| 16 | self.feature_linear = torch.nn.Linear(args.bert_feature_dim*2 + args.class_num*3, args.bert_feature_dim*2) |
| 17 | self.dropout_output = torch.nn.Dropout(0.1) |
| 18 | |
| 19 | def multi_hops(self, features, mask, k): |
| 20 | '''generate mask''' |
nothing calls this directly
no outgoing calls
no test coverage detected