code: def convert_gbdt_classifier_common(
      operator,
      tree_infos,
      get_tree_parameters,
      n_features,
      n_classes,
      classes=None,
      extra_config={},
      decision_cond="<=",
  ):
      """
      Common converter for GBDT classifiers.
  
      Args:
          tree_infos: The information representaing a tree (ensemble)
          get_tree_parameters: A function specifying how to parse the tree_infos into parameters
          n_features: The number of features input to the model
          n_classes: How many classes are expected. 1 for regression tasks
          classes: The classes used for classification. None if implementing a regression model
          extra_config: Extra configuration used to properly implement the source tree
          decision_cond: The condition of the decision nodes in the x <cond> threshold order. Default '<='. Values can be <=, <, >=, >
  
      Returns:
          A tree implementation in PyTorch
      """
      assert tree_infos is not None
      assert get_tree_parameters is not None
      assert n_features is not None
      assert n_classes is not None
  
      # Rearrange classes and tree information.
      if n_classes == 2:
          n_classes -= 1
      if classes is None:
          classes = [i for i in range(n_classes)]
  
      reorder_trees = True
      if constants.REORDER_TREES in extra_config:
          reorder_trees = extra_config[constants.REORDER_TREES]
      if reorder_trees and n_classes > 1:
          tree_infos = [
              tree_infos[i * n_classes + j]
              for j in range(n_classes)
              for i in range(len(tree_infos) // n_classes)
          ]
  
      return convert_gbdt_common(
          operator,
          tree_infos,
          get_tree_parameters,
          n_features,
          classes,
          extra_config=extra_config,
          decision_cond=decision_cond,
      )
  
file_path: hummingbird/hummingbird/ml/operator_converters/_gbdt_commons.py
imports: import torch
  import numpy
  from .None import constants
  from ._tree_commons import get_tree_params_and_type, get_parameters_for_tree_trav_common, get_parameters_for_gemm_common
  from ._tree_commons import PostTransform, ApplySigmoidPostTransform, ApplySoftmaxPostTransform, ApplyTweediePostTransform, ApplyBasePredictionPostTransform, ApplySigmoidBasePredictionPostTransform, ApplySoftmaxBasePredictionPostTransform, ApplyTweedieBasePredictionPostTransform
  from ._tree_implementations import GEMMGBDTImpl, TreeTraversalGBDTImpl, PerfectTreeTraversalGBDTImpl, TreeImpl
label_desc: Use image node_id 1 for calling a global function with example usage: convert_gbdt_classifier_common(operator, tree_infos, get_tree_parameters, n_features, n_classes, classes, extra_config, decision_cond) and returns: convert_gbdt_common