code: def tensor_to_vec(tensor):
      """Vectorises a tensor
  
      Parameters
      ----------
      tensor : ndarray
               tensor of shape ``(i_1, ..., i_n)``
  
      Returns
      -------
      1D-array
          vectorised tensor of shape ``(i_1 * i_2 * ... * i_n)``
      """
      return tl.reshape(tensor, (-1,))
  
file_path: tensorly/tensorly/base.py
imports: from math import prod
  from .None import backend
label_desc: Use image node_id 1 for calling a global function with example usage: tensor_to_vec(tensor) and returns: tl