code: def test_tucker_to_tensor():
      """Test for tucker_to_tensor"""
      X = tl.tensor(
          np.array(
              [
                  [[1.0, 13], [4, 16], [7, 19], [10, 22]],
                  [[2, 14], [5, 17], [8, 20], [11, 23]],
                  [[3, 15], [6, 18], [9, 21], [12, 24]],
              ]
          )
      )
      ranks = [2, 3, 4]
      U = [
          tl.tensor(np.arange(R * s, dtype=float).reshape((R, s)))
          for (R, s) in zip(ranks, tl.shape(X))
      ]
      true_res = np.array(
          [
              [
                  [390.0, 1518, 2646, 3774],
                  [1310, 4966, 8622, 12278],
                  [2230, 8414, 14598, 20782],
              ],
              [
                  [1524, 5892, 10260, 14628],
                  [5108, 19204, 33300, 47396],
                  [8692, 32516, 56340, 80164],
              ],
          ]
      )
      res = tucker_to_tensor((X, U))
      assert_array_equal(true_res, res)
  
file_path: tensorly/tensorly/tests/test_tucker_tensor.py
imports: import numpy
  from ..None import backend
  from ..base import unfold, tensor_to_vec
  from ..tucker_tensor import tucker_to_tensor, tucker_to_unfolded, tucker_to_vec, _validate_tucker_tensor, tucker_mode_dot, tucker_normalize, _tucker_n_param, validate_tucker_rank
  from ..tenalg import kronecker, mode_dot
  from ..testing import assert_array_equal, assert_array_almost_equal, assert_equal, assert_raises, assert_
  from ..random import random_tucker
label_desc: Use image node_id 2 for calling a global function with example usage: test_tucker_to_tensor() without return types