Beispiel #1
0
 def __call__(self,
              input_word_ids,
              input_mask=None,
              input_type_ids=None,
              **kwargs):
     inputs = tf_utils.pack_inputs(
         [input_word_ids, input_mask, input_type_ids])
     return super(BertModel, self).__call__(inputs, **kwargs)
Beispiel #2
0
 def __call__(self, input_tensor, attention_mask=None, **kwargs):
     inputs = tf_utils.pack_inputs([input_tensor, attention_mask])
     return super(Transformer, self).__call__(inputs=inputs, **kwargs)
Beispiel #3
0
 def __call__(self, from_tensor, to_tensor, attention_mask=None, **kwargs):
     inputs = tf_utils.pack_inputs([from_tensor, to_tensor, attention_mask])
     return super(Attention, self).__call__(inputs, **kwargs)
Beispiel #4
0
 def __call__(self, word_embeddings, token_type_ids=None, **kwargs):
     inputs = tf_utils.pack_inputs([word_embeddings, token_type_ids])
     return super(EmbeddingPostprocessor, self).__call__(inputs, **kwargs)