from tensorflow.python.framework import ops

      return math_ops.div(
          math_ops.reduce_sum(loss_vec),
          math_ops.to_float(math_ops.reduce_sum(weight_tensor)),
          name="loss")

  def _get_linear_vars(self):
    if self._get_linear_feature_columns():
      return ops.get_collection(self._linear_weight_collection)
    return []

  def _get_linear_training_ops(self, linear_grads, linear_vars):
    if self._get_linear_feature_columns():
      self._linear_optimizer = self._get_optimizer(
          self._linear_optimizer,
