code: def test_parafac2_to_slices(weights, factors, projections, true_res):
      weights = ivy.array(weights)
      factors = [ivy.array(f) for f in factors]
      projections = [ivy.array(p) for p in projections]
      true_res = [ivy.array(t) for t in true_res]
      for i, true_slice in enumerate(true_res):
          assert np.allclose(
              ivy.Parafac2Tensor.parafac2_to_slice(
                  (weights, factors, projections), i
              ),
              true_slice,
          )
  
      for true_slice, est_slice in zip(
          true_res,
          ivy.Parafac2Tensor.parafac2_to_slices(
              (weights, factors, projections)
          ),
      ):
          np.allclose(true_slice, est_slice)
  
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 3 for calling a global function with example usage: test_parafac2_to_slices(weights, factors, projections, true_res) without return types