code: def _tt_n_param(tensor_shape, rank):
      """Number of parameters of a MPS decomposition for a given `rank` and full `tensor_shape`.
  
      Parameters
      ----------
      tensor_shape : int tuple
          shape of the full tensor to decompose (or approximate)
  
      rank : tuple
          rank of the MPS decomposition
  
      Returns
      -------
      n_params : int
          Number of parameters of a MPS decomposition of rank `rank` of a full tensor of shape `tensor_shape`
      """
      factor_params = []
      for i, s in enumerate(tensor_shape):
          factor_params.append(rank[i] * s * rank[i + 1])
      return np.sum(factor_params)
  
imports: import tensorly
  from ._factorized_tensor import FactorizedTensor
  import numpy
  import warnings
label_desc: Use image node_id 5 for calling a global function with example usage: _tt_n_param(tensor_shape, rank) and returns: np