code: def test_complement_partial_fit(x_dtype, y_dtype, norm):
      chunk_size = 500
      n_rows, n_cols = 1500, 100
      weights = [0.6, 0.2, 0.15, 0.05]
      rtol = 1e-3 if x_dtype == cp.float32 else 1e-6
  
      X, y = make_classification(
          n_rows,
          n_cols,
          n_classes=len(weights),
          weights=weights,
          dtype=x_dtype,
          n_informative=9,
          random_state=1,
      )
      X -= X.min(0)  # Make all inputs positive
      y = y.astype(y_dtype)
  
      model = ComplementNB(norm=norm)
      modelsk = skComplementNB(norm=norm)
  
      classes = np.unique(y)
  
      for i in range(math.ceil(X.shape[0] / chunk_size)):
          upper = i * chunk_size + chunk_size
          if upper > X.shape[0]:
              upper = -1
  
          if upper > 0:
              x = X[i * chunk_size : upper]
              y_c = y[i * chunk_size : upper]
          else:
              x = X[i * chunk_size :]
              y_c = y[i * chunk_size :]
  
          model.partial_fit(x, y_c, classes=classes)
          modelsk.partial_fit(x.get(), y_c.get(), classes=classes.get())
          if upper == -1:
              break
  
      y_hat = model.predict_proba(X).get()
      y_sk = modelsk.predict_proba(X.get())
  
      assert_allclose(y_hat, y_sk, rtol=rtol)
  
imports: from cuml.internals.safe_imports import cpu_only_import
  import math
  from sklearn.naive_bayes import GaussianNB
  from sklearn.naive_bayes import ComplementNB
  from sklearn.naive_bayes import CategoricalNB
  from sklearn.naive_bayes import BernoulliNB
  from sklearn.naive_bayes import MultinomialNB
  from numpy.testing import assert_array_almost_equal, assert_raises
  from numpy.testing import assert_allclose, assert_array_equal
  from cuml.datasets import make_classification
  from cuml.internals.input_utils import sparse_scipy_to_cp
  from cuml.naive_bayes import GaussianNB
  from cuml.naive_bayes import ComplementNB
  from cuml.naive_bayes import CategoricalNB
  from cuml.naive_bayes import BernoulliNB
  from cuml.naive_bayes import MultinomialNB
  from sklearn.metrics import accuracy_score
  import pytest
  from cuml.internals.safe_imports import gpu_only_import
label_desc: Use image node_id 8 for calling a global function with example usage: test_complement_partial_fit(x_dtype, y_dtype, norm) without return types