code: def test_parafac2_to_unfolded(shape, rank):
      pf2_tensor = ivy.random_parafac2(shape, rank)
      full_tensor = ivy.Parafac2Tensor.parafac2_to_tensor(pf2_tensor)
      for mode in range(ivy.get_num_dims(full_tensor)):
          assert np.allclose(
              ivy.Parafac2Tensor.parafac2_to_unfolded(pf2_tensor, mode),
              ivy.unfold(full_tensor, mode),
          )
  
file_path: ivy/ivy_tests/test_ivy/test_misc/test_factorized_tensor/test_parafac2_tensor.py
imports: import ivy
  import numpy
  import pytest
label_desc: Use image node_id 5 for calling a global function with example usage: test_parafac2_to_unfolded(shape, rank) without return types