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

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

        def unilm_mask(s):
            idxs = K.cumsum(s, axis=1)
            mask = (idxs[:, None, :] <= idxs[:, :, None])
            mask = K.cast(mask, K.floatx())
            return ((- (1 - mask[:, None])) * 1000000000000.0)
        self.attention_bias = self.apply(inputs=self.inputs[1], layer=Lambda, function=unilm_mask, name='Attention-UniLM-Mask')
    return self.attention_bias