code: def test_dimension_compatibility(n_modes, n_response):
      """Tests CP_PLSR accepts x and y of different ranks and sizes."""
      x, y, _, _ = _get_pls_dataset(
          tuple([10] * n_modes), N_LATENT, n_response
      )
      try:
          pls = CP_PLSR(N_LATENT)
          pls.fit(x, y)
      except ValueError:
          raise AssertionError(
              f"Fit failed for {len(x.shape)}-dimensional tensor with "
              f"{n_response} response variables in y"
          )
  
imports: import numpy
  import pytest
  import tensorly
  from ...testing import assert_allclose
  from ...cp_tensor import CPTensor, cp_normalize, cp_to_tensor
  from ...metrics.factors import congruence_coefficient
  from ...random import random_cp
  from ..cp_plsr import CP_PLSR
label_desc: Use image node_id 7 for calling a global function with example usage: test_dimension_compatibility(n_modes, n_response) without return types