code: def factor_reshape(
      eigen_vectors, eigen_values, grad, fac_idx=0, f_type="act"
  ):
      """
      factor and reshape input eigen values
  
      :param eigen_vectors: ([TensorFlow Tensor]) eigen vectors
      :param eigen_values: ([TensorFlow Tensor]) eigen values
      :param grad: ([TensorFlow Tensor]) gradient
      :param fac_idx: (int) index that should be factored
      :param f_type: (str) function type to factor and reshape
      :return: ([TensorFlow Tensor], [TensorFlow Tensor]) factored and reshaped eigen vectors
              and eigen values
      """
      grad_shape = grad.get_shape()
      if f_type == "act":
          assert eigen_values.get_shape()[0] == grad_shape[fac_idx]
          expanded_shape = [
              1,
          ] * len(grad_shape)
          expanded_shape[fac_idx] = -1
          eigen_values = tf.reshape(eigen_values, expanded_shape)
      if f_type == "grad":
          assert (
              eigen_values.get_shape()[0]
              == grad_shape[len(grad_shape) - fac_idx - 1]
          )
          expanded_shape = [
              1,
          ] * len(grad_shape)
          expanded_shape[len(grad_shape) - fac_idx - 1] = -1
          eigen_values = tf.reshape(eigen_values, expanded_shape)
  
      return eigen_vectors, eigen_values
  
imports: import tensorflow
label_desc: Use image node_id 4 for calling a global function with example usage: factor_reshape(eigen_vectors, eigen_values, grad, fac_idx, f_type) and returns: eigen_vectors,  eigen_values