code: def test_parafac2_to_vec():
      """Test for parafac2_to_vec
  
      Notes
      -----
      Assumes that parafac2_to_tensor works correctly
      """
      rng = tl.check_random_state(12345)
      true_shape = [(4, 5)] * 3
      true_rank = 2
      pf2_tensor = random_parafac2(true_shape, true_rank)
      full_tensor = parafac2_to_tensor(pf2_tensor)
      assert_array_almost_equal(
          parafac2_to_vec(pf2_tensor), tensor_to_vec(full_tensor)
      )
  
file_path: tensorly/tensorly/tests/test_parafac2_tensor.py
imports: import numpy
  import pytest
  from ..None import backend
  from ..base import unfold, tensor_to_vec
  from ..parafac2_tensor import parafac2_to_tensor, parafac2_to_unfolded, parafac2_to_vec, _validate_parafac2_tensor, parafac2_to_slice, parafac2_to_slices, parafac2_normalise, apply_parafac2_projections
  from ..testing import assert_array_equal, assert_array_almost_equal, assert_equal, assert_raises
  from ..random import random_parafac2
label_desc: Use image node_id 6 for calling a global function with example usage: test_parafac2_to_vec() without return types