code: def test_fit(
      nrows,
      ncols,
      n_components,
      sparse_input,
      density,
      sparse_format,
      batch_size_divider,
      whiten,
  ):
      if sparse_format == "csc":
          pytest.skip(
              "cupyx.scipy.sparse.csc.csc_matrix does not support"
              " indexing as of cupy 7.6.0"
          )
  
      if sparse_input:
          X = cupyx.scipy.sparse.random(
              nrows,
              ncols,
              density=density,
              random_state=10,
              format=sparse_format,
          )
      else:
          X, _ = make_blobs(
              n_samples=nrows, n_features=ncols, random_state=10
          )
  
      cu_ipca = cuIPCA(
          n_components=n_components,
          whiten=whiten,
          batch_size=int(nrows / batch_size_divider),
      )
      cu_ipca.fit(X)
      cu_t = cu_ipca.transform(X)
      cu_inv = cu_ipca.inverse_transform(cu_t)
  
      sk_ipca = skIPCA(
          n_components=n_components,
          whiten=whiten,
          batch_size=int(nrows / batch_size_divider),
      )
      if sparse_input:
          X = X.get()
      else:
          X = cp.asnumpy(X)
      sk_ipca.fit(X)
      sk_t = sk_ipca.transform(X)
      sk_inv = sk_ipca.inverse_transform(sk_t)
  
      assert array_equal(cu_inv, sk_inv, 5e-5, with_sign=True)
  
file_path: cuml/python/cuml/tests/test_incremental_pca.py
imports: from cuml.common.exceptions import NotFittedError
  from cuml.testing.utils import array_equal
  from cuml.decomposition.incremental_pca import _svd_flip
  from cuml.decomposition import IncrementalPCA
  from cuml.datasets import make_blobs
  from sklearn.decomposition import IncrementalPCA
  import pytest
  from cuml.internals.safe_imports import gpu_only_import
label_desc: Use image node_id 1 for calling a global function with example usage: test_fit(nrows, ncols, n_components, sparse_input, density, sparse_format, batch_size_divider, whiten) without return types