docstr: Return number of parameters of a CP decomposition for a given `rank`
  and full `tensor_shape`.
  
  Parameters
  ----------
  tensor_shape
      shape of the full tensor to decompose (or approximate)
  rank
      rank of the CP decomposition
  
  Returns
  -------
  n_params
      Number of parameters of a CP decomposition of rank `rank`
        of a full tensor of shape `tensor_shape`
docstr_tok: ["Return","number","of","parameters","of","a","CP","decomposition","for","a","given","`","rank","`","and","full","`","tensor_shape","`",".","Parameters","--","--","--","--","--","tensor_shape","shape","of","the","full","tensor","to","decompose","(","or","approximate",")","rank","rank","of","the","CP","decomposition","Returns","--","--","--","-","n_params","Number","of","parameters","of","a","CP","decomposition","of","rank","`","rank","`","of","a","full","tensor","of","shape","`","tensor_shape","`"]
code: def cp_n_param(tensor_shape, rank, weights=False):
      """Return number of parameters of a CP decomposition for a given `rank`
      and full `tensor_shape`.
  
      Parameters
      ----------
      tensor_shape
          shape of the full tensor to decompose (or approximate)
      rank
          rank of the CP decomposition
  
      Returns
      -------
      n_params
          Number of parameters of a CP decomposition of rank `rank`
            of a full tensor of shape `tensor_shape`
      """
      factors_params = rank * ivy.sum(tensor_shape)
      if weights:
          return factors_params + rank
      else:
          return factors_params
  
imports: from .base import FactorizedTensor
  import ivy
label_desc: Use image node_id 16 for calling the CPTensor obj's underlying member method code with example usage: obj.cp_n_param(tensor_shape, rank, weights) and returns: unknown, factors_params