code: def test_partial_vec_to_tensor():
      """Test for partial_vec_to_tensor"""
      X = np.arange(24).reshape((3, 4, 2))
  
      vectorised = 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,
              ],
              [
                  1,
                  2,
                  3,
                  4,
                  5,
                  6,
                  7,
                  8,
                  9,
                  10,
                  11,
                  12,
                  13,
                  14,
                  15,
                  16,
                  17,
                  18,
                  19,
                  20,
                  21,
                  22,
                  23,
                  24,
              ],
              [
                  2,
                  3,
                  4,
                  5,
                  6,
                  7,
                  8,
                  9,
                  10,
                  11,
                  12,
                  13,
                  14,
                  15,
                  16,
                  17,
                  18,
                  19,
                  20,
                  21,
                  22,
                  23,
                  24,
                  25,
              ],
          ]
      )
      folded = partial_vec_to_tensor(
          vectorised, (3, 3, 4, 2), skip_begin=1
      )
      for i in range(3):
          assert_array_equal(folded[i], X + i)
  
      shape = [3, 4, 5, 6]
      X = T.tensor(np.random.random(shape))
      for i in [0, 1]:
          vec = partial_tensor_to_vec(X, skip_begin=i, skip_end=(1 - i))
          ten = partial_vec_to_tensor(
              vec, shape=shape, skip_begin=i, skip_end=(1 - i)
          )
          assert_array_equal(X, ten)
  
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 8 for calling a global function with example usage: test_partial_vec_to_tensor() without return types