code: def tt_to_tensor(factors):
      """Returns the full tensor whose TT decomposition is given by 'factors'
  
          Re-assembles 'factors', which represent a tensor in TT/Matrix-Product-State format
          into the corresponding full tensor
  
      Parameters
      ----------
      factors : list of 3D-arrays
                TT factors (TT-cores)
  
      Returns
      -------
      output_tensor : ndarray
                     tensor whose TT/MPS decomposition was given by 'factors'
      """
      if isinstance(factors, (float, int)):  # 0-order tensor
          return factors
  
      full_shape = [f.shape[1] for f in factors]
      full_tensor = tl.reshape(factors[0], (full_shape[0], -1))
  
      for factor in factors[1:]:
          rank_prev, _, rank_next = factor.shape
          factor = tl.reshape(factor, (rank_prev, -1))
          full_tensor = tl.dot(full_tensor, factor)
          full_tensor = tl.reshape(full_tensor, (-1, rank_next))
  
      return tl.reshape(full_tensor, full_shape)
  
imports: import tensorly
  from ._factorized_tensor import FactorizedTensor
  import numpy
  import warnings
label_desc: Use image node_id 2 for calling a global function with example usage: tt_to_tensor(factors) and returns: tl, factors