def call(self, inputs, training=False):
    (x, attention_mask, head_mask) = inputs
    x = self.c_attn(x)
    (query, key, value) = tf.split(x, 3, axis=2)
    query = self.split_heads(query)
    key = self.split_heads(key)
    value = self.split_heads(value)
    attn_outputs = self._attn([query, key, value, attention_mask, head_mask], training=training)
    a = attn_outputs[0]
    a = self.merge_heads(a)
    a = self.c_proj(a)
    a = self.resid_dropout(a, training=training)
    outputs = ([a] + attn_outputs[1:])
    return outputs
def call(self, inputs, training=False):
    (x, attention_mask, head_mask) = inputs
    x = self.c_attn(x)
    (query, key, value) = tf.split(x, 3, axis=2)
    query = self.split_heads(query)
    key = self.split_heads(key)
    value = self.split_heads(value)
    attn_outputs = self._attn([query, key, value, attention_mask, head_mask], training=training)
    a = attn_outputs[0]
    a = self.merge_heads(a)
    a = self.c_proj(a)
    a = self.resid_dropout(a, training=training)
    outputs = ([a] + attn_outputs[1:])
    return outputs