def compute_attention_bias(self, inputs=None):
    '通过idxs序列的比较来得到对应的mask\n        '
    if (self.attention_bias is None):

        def lm_mask(s):
            seq_len = K.shape(s)[1]
            idxs = K.arange(0, seq_len)
            mask = (idxs[None, :] <= idxs[:, None])
            mask = K.cast(mask, K.floatx())
            return ((- (1 - mask[(None, None)])) * 1000000000000.0)
        self.attention_bias = self.apply(inputs=self.inputs[0], layer=Lambda, function=lm_mask, name='Attention-LM-Mask')
    return self.attention_bias
通过idxs序列的比较来得到对应的mask
def compute_attention_bias(self, inputs=None):
    '\n        '
    if (self.attention_bias is None):

        def lm_mask(s):
            seq_len = K.shape(s)[1]
            idxs = K.arange(0, seq_len)
            mask = (idxs[None, :] <= idxs[:, None])
            mask = K.cast(mask, K.floatx())
            return ((- (1 - mask[(None, None)])) * 1000000000000.0)
        self.attention_bias = self.apply(inputs=self.inputs[0], layer=Lambda, function=lm_mask, name='Attention-LM-Mask')
    return self.attention_bias