code: def convert_sklearn_xgb_regressor(operator, device, extra_config):
      """
      Converter for `xgboost.XGBRegressor` (trained using the Sklearn API).
  
      Args:
          operator: An operator wrapping a `xgboost.XGBRegressor` model
          device: String defining the type of device the converted operator should be run on
          extra_config: Extra configuration used to select the best conversion strategy
  
      Returns:
          A PyTorch model
      """
      assert operator is not None, "Cannot convert None operator"
      if "n_features" in extra_config:
          n_features = extra_config["n_features"]
      else:
          raise RuntimeError(
              'XGBoost converter is not able to infer the number of input features.\
               Please pass "n_features:N" as extra configuration to the converter or fill a bug report.'
          )
  
      tree_infos = operator.raw_operator.get_booster().get_dump()
      if hasattr(operator.raw_operator.get_booster(), "feature_names"):
          feature_names = (
              operator.raw_operator.get_booster().feature_names
          )
          if feature_names is not None:
              extra_config[constants.FEATURE_NAMES] = feature_names
      base_prediction = operator.raw_operator.base_score
      if base_prediction is None:
          base_prediction = [0.5]
      if type(base_prediction) is float:
          base_prediction = [base_prediction]
  
      extra_config[constants.BASE_PREDICTION] = base_prediction
  
      return convert_gbdt_common(
          operator,
          tree_infos,
          _get_tree_parameters,
          n_features,
          decision_cond="<",
          extra_config=extra_config,
      )
  
file_path: hummingbird/hummingbird/ml/operator_converters/xgb.py
imports: import numpy
  from onnxconverter_common.registration import register_converter
  from .None import constants
  from ._gbdt_commons import convert_gbdt_classifier_common, convert_gbdt_common
  from ._tree_commons import TreeParameters
label_desc: Use image node_id 4 for calling a global function with example usage: convert_sklearn_xgb_regressor(operator, device, extra_config) and returns: convert_gbdt_common