def METHOD_NAME(self, features, labels, mode, params):
    """
    featurs: type dict, key is the feature name and value is tensor.
             In this case. it is like {"x": Tensor}.
    labels: type tensor, corresponding to the colum which `is_label` equals True. # noqa: E501
            In this case, it is like Tensor.
    """
    wide_column, fm_column, deep_column = build_feature_columns()
    # input_layer_partitioner = None
    with tf.variable_scope(
        "input_layer",
        partitioner=input_layer_partitioner,
        reuse=tf.AUTO_REUSE,
    ):
        fm_cols = {}
        dnn_input = tf.feature_column.input_layer(features, deep_column)
        wide_input = tf.feature_column.input_layer(
            features, wide_column, cols_to_output_tensors=fm_cols
        )
        fm_input = tf.stack([fm_cols[cols] for cols in fm_column], 1)
    layer_name = ""
    with tf.variable_scope("dnn"):
        for layer_id, num_hidden_units in enumerate(dnn_hidden_units):
            with tf.variable_scope(
                layer_name + "_%d" % layer_id, reuse=tf.AUTO_REUSE
            ) as dnn_layer_scope:
                dnn_input = tf.layers.dense(
                    dnn_input,
                    units=num_hidden_units,
                    activation=tf.nn.relu,
                    name=dnn_layer_scope,
                )
    dnn_output = dnn_input
    with tf.variable_scope("linear", reuse=tf.AUTO_REUSE):
        linear_output = tf.reduce_sum(wide_input, axis=1, keepdims=True)
    # FM second order part
    with tf.variable_scope("fm", reuse=tf.AUTO_REUSE):
        sum_square = tf.square(tf.reduce_sum(fm_input, axis=1))
        square_sum = tf.reduce_sum(tf.square(fm_input), axis=1)
        fm_output = 0.5 * tf.subtract(sum_square, square_sum)
    # Final dnn layer
    all_input = tf.concat([dnn_output, linear_output, fm_output], 1)
    dnn_input = all_input
    with tf.variable_scope("final_dnn"):
        for layer_id, num_hidden_units in enumerate(final_hidden_units):
            with tf.variable_scope(
                layer_name + "_%d" % layer_id,
                partitioner=input_layer_partitioner,
                reuse=tf.AUTO_REUSE,
            ) as dnn_layer_scope:
                dnn_input = tf.layers.dense(
                    dnn_input,
                    units=num_hidden_units,
                    activation=tf.nn.relu,
                    name=dnn_layer_scope,
                )
    logits = tf.layers.dense(dnn_input, units=1)
    probability = tf.math.sigmoid(logits)
    loss_func = tf.losses.mean_squared_error
    prediction = tf.squeeze(probability)
    loss = tf.math.reduce_mean(loss_func(labels, prediction))
    if mode == tf.estimator.ModeKeys.PREDICT:
        return tf.estimator.EstimatorSpec(mode, predictions=prediction)
    loss = tf.losses.mean_squared_error(labels, prediction)
    optimizer = tf.train.AdamOptimizer(
        learning_rate=0.01, beta1=0.9, beta2=0.999, epsilon=1e-8
    )
    update_ops = tf.get_collection(tf.GraphKeys.UPDATE_OPS)
    with tf.control_dependencies(update_ops):
        train_op = optimizer.minimize(
            loss, global_step=tf.train.get_or_create_global_step()
        )
    if mode == tf.estimator.ModeKeys.EVAL:
        metrics = {
            "auc": tf.metrics.auc(
                labels=labels, predictions=probability, num_thresholds=1000
            )
        }
        return tf.estimator.EstimatorSpec(
            mode,
            predictions=prediction,
            eval_metric_ops=metrics,
            loss=loss,
        )
    if mode == tf.estimator.ModeKeys.TRAIN:
        return tf.estimator.EstimatorSpec(
            mode, predictions=prediction, loss=loss, train_op=train_op
        )
    raise ValueError("Not a valid mode: {}".format(mode))