code: def test_threads_per_tree(
      train_device,
      infer_device,
      threads_per_tree,
      small_classifier_and_preds,
  ):
      with using_device_type(train_device):
          (
              model_path,
              model_type,
              X,
              xgb_preds,
          ) = small_classifier_and_preds
          fm = ForestInference.load(
              model_path, output_class=True, model_type=model_type
          )
  
      with using_device_type(infer_device):
          fil_preds = np.asarray(
              fm.predict(X, chunk_size=threads_per_tree)
          )
          fil_proba = np.asarray(
              fm.predict_proba(X, chunk_size=threads_per_tree)
          )
          fil_proba = np.reshape(fil_proba, xgb_preds.shape)
  
          np.testing.assert_allclose(
              fil_proba, xgb_preds, atol=proba_atol[False]
          )
  
          xgb_preds_int = np.around(xgb_preds)
          fil_preds = np.reshape(fil_preds, np.shape(xgb_preds_int))
          assert np.allclose(fil_preds, xgb_preds_int, 1e-3)
  
imports: import numpy
  import pytest
  import os
  import pandas
  from math import ceil
  from cuml.experimental import ForestInference
  from cuml.testing.utils import array_equal, unit_param, quality_param, stress_param
  from cuml.internals.import_utils import has_lightgbm, has_xgboost
  from cuml.common.device_selection import using_device_type
  from sklearn.datasets import make_classification, make_regression
  from sklearn.ensemble import GradientBoostingClassifier, GradientBoostingRegressor, RandomForestClassifier, RandomForestRegressor, ExtraTreesClassifier, ExtraTreesRegressor
  from sklearn.metrics import accuracy_score, mean_squared_error
  from sklearn.model_selection import train_test_split
  import treelite
label_desc: Use image node_id 9 for calling a global function with example usage: test_threads_per_tree(train_device, infer_device, threads_per_tree, small_classifier_and_preds) without return types