code: def test_svd_solver_auto(setup):
      rng = np.random.RandomState(0)
      X = mt.tensor(rng.uniform(size=(1000, 50)))
  
      # case: n_components in (0,1) => 'full'
      pca = PCA(n_components=0.5)
      pca.fit(X)
      pca_test = PCA(n_components=0.5, svd_solver="full")
      pca_test.fit(X)
      assert_array_almost_equal(
          pca.components_.to_numpy(), pca_test.components_.to_numpy()
      )
  
      # case: max(X.shape) <= 500 => 'full'
      pca = PCA(n_components=5, random_state=0)
      Y = X[:10, :]
      pca.fit(Y)
      pca_test = PCA(n_components=5, svd_solver="full", random_state=0)
      pca_test.fit(Y)
      assert_array_almost_equal(
          pca.components_.to_numpy(), pca_test.components_.to_numpy()
      )
  
      # case: n_components >= .8 * min(X.shape) => 'full'
      pca = PCA(n_components=50)
      pca.fit(X)
      pca_test = PCA(n_components=50, svd_solver="full")
      pca_test.fit(X)
      assert_array_almost_equal(
          pca.components_.to_numpy(), pca_test.components_.to_numpy()
      )
  
      # n_components >= 1 and n_components < .8 * min(X.shape) => 'randomized'
      pca = PCA(n_components=10, random_state=0)
      pca.fit(X)
      pca_test = PCA(
          n_components=10, svd_solver="randomized", random_state=0
      )
      pca_test.fit(X)
      assert_array_almost_equal(
          pca.components_.to_numpy(), pca_test.components_.to_numpy()
      )
  
imports: from itertools import product
  import numpy
  import pytest
  import scipy
  from sklearn import datasets
  from sklearn.utils._testing import assert_array_almost_equal, assert_almost_equal, assert_raises_regex, assert_raise_message, assert_raises
  from ....None import tensor
  from .._pca import PCA, _assess_dimension, _infer_dimension
label_desc: Use image node_id 24 for calling a global function with example usage: test_svd_solver_auto(setup) without return types