code: def test_vec_to_tensor():
      """Test for tensor_to_vec"""
      X = T.tensor(
          [
              [[0, 1], [2, 3], [4, 5], [6, 7]],
              [[8, 9], [10, 11], [12, 13], [14, 15]],
              [[16, 17], [18, 19], [20, 21], [22, 23]],
          ]
      )
      vec = T.tensor(
          [
              0,
              1,
              2,
              3,
              4,
              5,
              6,
              7,
              8,
              9,
              10,
              11,
              12,
              13,
              14,
              15,
              16,
              17,
              18,
              19,
              20,
              21,
              22,
              23,
          ]
      )
      assert_array_equal(X, vec_to_tensor(vec, X.shape))
  
      # Convert to vector and back to tensor
      X = T.tensor(np.random.random((3, 4, 5, 2)))
      vec = tensor_to_vec(X)
      reconstructed = vec_to_tensor(vec, X.shape)
      assert_array_equal(X, reconstructed)
  
file_path: tensorly/tensorly/tests/test_core.py
imports: import numpy
  from ..None import backend
  from ..base import fold, unfold
  from ..base import partial_fold, partial_unfold
  from ..base import tensor_to_vec, vec_to_tensor
  from ..base import partial_tensor_to_vec, partial_vec_to_tensor
  from ..base import matricize
  from ..testing import assert_array_equal, assert_raises
label_desc: Use image node_id 4 for calling a global function with example usage: test_vec_to_tensor() without return types