code: def tt_matrix_to_tensor(
      tt_matrix: Union[ivy.Array, ivy.NativeArray],
      /,
      *,
      out: Optional[ivy.Array] = None,
  ) -> ivy.Array:
      """Return the full tensor whose TT-Matrix decomposition is given by
      'factors' Re- assembles 'factors', which represent a tensor in TT-Matrix
      format into the corresponding full tensor.
  
      Parameters
      ----------
      tt_matrix
              array of 4D-arrays
              TT-Matrix factors (known as core) of shape
              (rank_k, left_dim_k, right_dim_k, rank_{k+1})
  
      out
          Optional output array. If provided, the output array to store the result.
  
      Returns
      -------
      output_tensor: array
                  tensor whose TT-Matrix decomposition was given by 'factors'
  
      Examples
      --------
      >>> x = ivy.array([[[[[0.49671414],
      ...                      [-0.1382643]],
      ...
      ...                     [[0.64768857],
      ...                      [1.5230298]]]],
      ...                   [[[[-0.23415337],
      ...                      [-0.23413695]],
      ...
      ...                     [[1.57921278],
      ...                      [0.76743472]]]]])
      >>> y = ivy.tt_matrix_to_tensor(x)
      >>> print(y)
      ivy.array([[[[-0.1163073 , -0.11629914],
      [ 0.03237505,  0.03237278]],
  
      [[ 0.78441733,  0.38119566],
      [-0.21834874, -0.10610882]]],
  
  
      [[[-0.15165846, -0.15164782],
      [-0.35662258, -0.35659757]],
  
      [[ 1.02283812,  0.49705869],
      [ 2.40518808,  1.16882598]]]])
      """
      _, in_shape, out_shape, _ = zip(*(f.shape for f in tt_matrix))
      ndim = len(in_shape)
      full_shape = sum(zip(*(in_shape, out_shape)), ())
      order = list(range(0, ndim * 2, 2)) + list(range(1, ndim * 2, 2))
      for i, factor in enumerate(tt_matrix):
          if not i:
              res = factor
          else:
              res = ivy.tensordot(
                  res, factor, axes=([len(res.shape) - 1], [0])
              )
      return ivy.permute_dims(
          ivy.reshape(res, full_shape), axes=order, out=out
      )
  
imports: import logging
  from typing import Union, Optional, Tuple, List, Sequence, Literal
  import ivy
  from ivy.utils.backend import current_backend
  from ivy.func_wrapper import to_native_arrays_and_back, handle_out_argument, handle_nestable, handle_array_like_without_promotion, handle_array_function, handle_device, inputs_to_ivy_arrays, handle_backend_invalid
  from ivy.utils.exceptions import handle_exceptions
label_desc: Use image node_id 25 for calling a global function with example usage: tt_matrix_to_tensor() and returns: ivy