code: def test_svd_compression_doesnt_disturb_error(normalize_factors):
      """The SSE for the compressed data is equal to the SSE of the uncompressed data"""
      rng = tl.check_random_state(1234)
      rank = 3
  
      random_parafac2_tensor = random_parafac2(
          shapes=[(20 + rng.randint(5), 19) for _ in range(10)],
          rank=rank,
          random_state=rng,
          dtype=tl.float64,
      )
  
      slices = parafac2_to_slices(random_parafac2_tensor)
      compressed_slices, loadings = svd_compress_tensor_slices(
          slices, compression_threshold=0
      )
      rec_pf2 = parafac2(
          compressed_slices,
          rank,
          random_state=rng,
          normalize_factors=normalize_factors,
          n_iter_max=100,
      )
  
      decompressed_pf2 = svd_decompress_parafac2_tensor(
          rec_pf2, loadings
      )
      compressed_error = _parafac2_reconstruction_error(
          compressed_slices, rec_pf2
      )
      decompressed_error = _parafac2_reconstruction_error(
          slices, decompressed_pf2
      )
      assert tl.to_numpy(compressed_error) == approx(
          tl.to_numpy(decompressed_error)
      )
  
file_path: tensorly/tensorly/tests/test_preprocessing.py
imports: import pytest
  from pytest import approx
  import numpy
  import tensorly
  from ..parafac2_tensor import parafac2_to_slices
  from ..random import random_parafac2
  from ..testing import assert_allclose
  from ..decomposition._parafac2 import parafac2, _parafac2_reconstruction_error
  from ..preprocessing import svd_compress_tensor_slices, svd_decompress_parafac2_tensor
label_desc: Use image node_id 2 for calling a global function with example usage: test_svd_compression_doesnt_disturb_error(normalize_factors) without return types