Esempio n. 1
0
 def __call__(self,
              pooled_output,
              sequence_output=None,
              masked_lm_positions=None):
     inputs = tf_utils.pack_inputs(
         [pooled_output, sequence_output, masked_lm_positions])
     return super(PGNetTrainLayer, self).__call__(inputs)
Esempio n. 2
0
 def __call__(self,
              pooled_output,
              sequence_output=None,
              masked_lm_positions=None,
              **kwargs):
     inputs = tf_utils.pack_inputs(
         [pooled_output, sequence_output, masked_lm_positions])
     return super(BertPretrainLayer, self).__call__(inputs, **kwargs)
Esempio n. 3
0
 def __call__(self,
              lm_output,
              sentence_output=None,
              lm_label_ids=None,
              lm_label_weights=None,
              sentence_labels=None,
              **kwargs):
     inputs = tf_utils.pack_inputs([
         lm_output, sentence_output, lm_label_ids, lm_label_weights,
         sentence_labels
     ])
     return super(BertPretrainLossAndMetricLayer,
                  self).__call__(inputs, **kwargs)
Esempio n. 4
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)
Esempio n. 5
0
 def __call__(self, input_tensor, attention_mask=None):
     inputs = tf_utils.pack_inputs([input_tensor, attention_mask])
     return super(TransformerBlock, self).__call__(inputs)
Esempio n. 6
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)
Esempio n. 7
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)
Esempio n. 8
0
 def __call__(self, input_word_ids, input_mask=None, input_type_ids=None):
     inputs = tf_utils.pack_inputs(
         [input_word_ids, input_mask, input_type_ids])
     return super(BertModel, self).__call__(inputs)