code: def test_svd_compression_compresses_only_when_necessary():
      """Compression is only done when the number of rows is less than the number of columns and compression_threshold != 0"""
      rng = tl.check_random_state(1234)
      tensor_slices = [
          tl.tensor(rng.standard_normal((25, 10)), dtype=tl.float64),
          tl.tensor(rng.standard_normal((10, 10)), dtype=tl.float64),
      ]
      compressed_slices, loadings = svd_compress_tensor_slices(
          tensor_slices
      )
  
      # First slice is compressed
      assert compressed_slices[0] is not tensor_slices[0]
      assert compressed_slices[0].shape == (10, 10)
      assert loadings[0].shape == (25, 10)
  
      # Second slice is not compressed
      assert compressed_slices[1] is tensor_slices[1]
      assert loadings[1] is None
  
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 3 for calling a global function with example usage: test_svd_compression_compresses_only_when_necessary() without return types