code: def cp_to_vec(cp_tensor):
      """Turns the khatri-product of matrices into a vector
  
          (the tensor ``factors = [|U_1, ... U_n|]``
          is converted into a raveled mode-0 unfolding)
  
      Parameters
      ----------
      cp_tensor : CPTensor = (weight, factors)
          factors is a list of matrices, all with the same number of columns
          i.e.::
  
              for u in U:
                  u[i].shape == (s_i, R)
  
          where `R` is fixed while `s_i` can vary with `i`
  
      Returns
      -------
      ndarray
          vectorised tensor
      """
      return tensor_to_vec(cp_to_tensor(cp_tensor))
  
imports: from .None import backend
  from .base import fold, tensor_to_vec
  from ._factorized_tensor import FactorizedTensor
  from .tenalg import khatri_rao, unfolding_dot_khatri_rao
  from .metrics.factors import congruence_coefficient
  import numpy
label_desc: Use image node_id 9 for calling a global function with example usage: cp_to_vec(cp_tensor) and returns: tensor_to_vec