code: def test_train_gpu_infer_cpu(test_data):
      cuEstimator = test_data["cuEstimator"]
      if cuEstimator is UMAP:
          pytest.skip(
              "UMAP GPU training CPU inference not yet implemented"
          )
  
      model = cuEstimator(**test_data["kwargs"])
      with using_device_type("gpu"):
          if "y_train" in test_data:
              model.fit(test_data["X_train"], test_data["y_train"])
          else:
              model.fit(test_data["X_train"])
      with using_device_type("cpu"):
          infer_func = getattr(model, test_data["infer_func"])
          infer_func_kwargs = test_data.get("infer_func_kwargs", {})
          cuml_output = infer_func(
              test_data["X_test"], **infer_func_kwargs
          )
  
      assert_func = test_data["assert_func"]
      assert_func(cuml_output, test_data)
  
imports: import platform
  from cuml.testing.test_preproc_utils import to_output_type
  from cuml.testing.utils import array_equal
  from cuml.cluster.hdbscan import HDBSCAN
  from cuml.neighbors import NearestNeighbors
  from cuml.metrics import trustworthiness
  from cuml.metrics import adjusted_rand_score
  from cuml.manifold import UMAP
  from cuml.linear_model import ElasticNet, Lasso, LinearRegression, LogisticRegression, Ridge
  from cuml.internals.memory_utils import using_memory_type
  from cuml.internals.mem_type import MemoryType
  from cuml.decomposition import PCA, TruncatedSVD
  from cuml.common.device_selection import DeviceType, using_device_type
  from hdbscan import HDBSCAN
  from sklearn.neighbors import NearestNeighbors
  from sklearn.linear_model import Ridge
  from sklearn.linear_model import ElasticNet
  from sklearn.linear_model import Lasso
  from sklearn.linear_model import LogisticRegression
  from sklearn.linear_model import LinearRegression
  from sklearn.decomposition import PCA
  from sklearn.decomposition import TruncatedSVD
  from sklearn.datasets import make_regression, make_blobs
  from pytest_cases import fixture_union, fixture_plus
  from importlib import import_module
  import inspect
  import pickle
  from cuml.internals.safe_imports import gpu_only_import
  import itertools
  import pytest
  import cuml
  from cuml.internals.safe_imports import cpu_only_import
label_desc: Use image node_id 23 for calling a global function with example usage: test_train_gpu_infer_cpu(test_data) without return types