def _iteration_l_moments_dense(
    current_index, l1_sum, l2_sum, l3_sum, l4_sum, l1_factors, l2_factors,
    l3_factors, l4_factors, x_rank_2):
  """Process one column of a `Tensor` and updates L-moments variables."""
  current_x = x_rank_2[:, current_index]
  sorted_x = tf.sort(current_x)

  dim_1 = tf.shape(x_rank_2)[1]
  new_l1_sum = l1_sum + tf.scatter_nd(
      [[current_index]],
      [tf.reduce_sum(tf.multiply(sorted_x, l1_factors), axis=0)], [dim_1])
  new_l2_sum = l2_sum + tf.scatter_nd(
      [[current_index]],
      [tf.reduce_sum(tf.multiply(sorted_x, l2_factors), axis=0)], [dim_1])
  new_l3_sum = l3_sum + tf.scatter_nd(
      [[current_index]],
      [tf.reduce_sum(tf.multiply(sorted_x, l3_factors), axis=0)], [dim_1])
  new_l4_sum = l4_sum + tf.scatter_nd(
      [[current_index]],
      [tf.reduce_sum(tf.multiply(sorted_x, l4_factors), axis=0)], [dim_1])
  return (tf.add(current_index, 1),
          new_l1_sum, new_l2_sum, new_l3_sum, new_l4_sum, l1_factors,
          l2_factors, l3_factors, l4_factors, x_rank_2)
Process one column of a `Tensor` and updates L-moments variables.
tensorflow_transform/tf_utils.py