def apply_final_layers(self, inputs):
    '根据剩余参数决定输出\n        '
    x = inputs
    z = self.layer_norm_conds[0]
    outputs = [x]
    if self.with_pool:
        x = outputs[0]
        x = self.apply(inputs=x, layer=Lambda, function=(lambda x: x[:, 0]), name='Pooler')
        pool_activation = ('tanh' if (self.with_pool is True) else self.with_pool)
        x = self.apply(inputs=x, layer=Dense, units=self.hidden_size, activation=pool_activation, kernel_initializer=self.initializer, name='Pooler-Dense')
        if self.with_nsp:
            x = self.apply(inputs=x, layer=Dense, units=2, activation='softmax', kernel_initializer=self.initializer, name='NSP-Proba')
        outputs.append(x)
    if self.with_mlm:
        x = outputs[0]
        x = self.apply(inputs=x, layer=Dense, units=self.embedding_size, activation=self.hidden_act, kernel_initializer=self.initializer, name='MLM-Dense')
        x = self.apply(inputs=self.simplify([x, z]), layer=LayerNormalization, conditional=(z is not None), hidden_units=self.layer_norm_conds[1], hidden_activation=self.layer_norm_conds[2], hidden_initializer=self.initializer, name='MLM-Norm')
        x = self.apply(inputs=x, layer=Embedding, arguments={'mode': 'dense'}, name='Embedding-Token')
        x = self.apply(inputs=x, layer=BiasAdd, name='MLM-Bias')
        mlm_activation = ('softmax' if (self.with_mlm is True) else self.with_mlm)
        x = self.apply(inputs=x, layer=Activation, activation=mlm_activation, name='MLM-Activation')
        outputs.append(x)
    if (len(outputs) == 1):
        outputs = outputs[0]
    elif (len(outputs) == 2):
        outputs = outputs[1]
    else:
        outputs = outputs[1:]
    return outputs
根据剩余参数决定输出
def apply_final_layers(self, inputs):
    '\n        '
    x = inputs
    z = self.layer_norm_conds[0]
    outputs = [x]
    if self.with_pool:
        x = outputs[0]
        x = self.apply(inputs=x, layer=Lambda, function=(lambda x: x[:, 0]), name='Pooler')
        pool_activation = ('tanh' if (self.with_pool is True) else self.with_pool)
        x = self.apply(inputs=x, layer=Dense, units=self.hidden_size, activation=pool_activation, kernel_initializer=self.initializer, name='Pooler-Dense')
        if self.with_nsp:
            x = self.apply(inputs=x, layer=Dense, units=2, activation='softmax', kernel_initializer=self.initializer, name='NSP-Proba')
        outputs.append(x)
    if self.with_mlm:
        x = outputs[0]
        x = self.apply(inputs=x, layer=Dense, units=self.embedding_size, activation=self.hidden_act, kernel_initializer=self.initializer, name='MLM-Dense')
        x = self.apply(inputs=self.simplify([x, z]), layer=LayerNormalization, conditional=(z is not None), hidden_units=self.layer_norm_conds[1], hidden_activation=self.layer_norm_conds[2], hidden_initializer=self.initializer, name='MLM-Norm')
        x = self.apply(inputs=x, layer=Embedding, arguments={'mode': 'dense'}, name='Embedding-Token')
        x = self.apply(inputs=x, layer=BiasAdd, name='MLM-Bias')
        mlm_activation = ('softmax' if (self.with_mlm is True) else self.with_mlm)
        x = self.apply(inputs=x, layer=Activation, activation=mlm_activation, name='MLM-Activation')
        outputs.append(x)
    if (len(outputs) == 1):
        outputs = outputs[0]
    elif (len(outputs) == 2):
        outputs = outputs[1]
    else:
        outputs = outputs[1:]
    return outputs