code: def convert_sklearn_linear_model(operator, device, extra_config):
      """
      Converter for `sklearn.svm.LinearSVC`, `sklearn.linear_model.LogisticRegression`,
      `sklearn.linear_model.SGDClassifier`, and `sklearn.linear_model.LogisticRegressionCV`
  
      Args:
          operator: An operator wrapping a `sklearn.svm.LinearSVC`, `sklearn.linear_model.LogisticRegression`,
              `sklearn.linear_model.SGDClassifier`, or `sklearn.linear_model.LogisticRegressionCV` 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"
  
      supported_loss = {"log_loss", "modified_huber", "squared_hinge"}
      classes = (
          [0]
          if not hasattr(operator.raw_operator, "classes_")
          else operator.raw_operator.classes_
      )
  
      if not all(["int" in str(type(x)) for x in classes]):
          raise RuntimeError(
              "Hummingbird currently supports only integer labels for class labels. Please file an issue at https://github.com/microsoft/hummingbird."
          )
  
      coefficients = operator.raw_operator.coef_.transpose().astype(
          "float32"
      )
  
      intercepts = operator.raw_operator.intercept_
      if np.ndim(intercepts) == 0:
          intercepts = np.array(intercepts, dtype="float32")
      else:
          intercepts = intercepts.reshape(1, -1).astype("float32")
  
      multi_class = None
      loss = None
      if hasattr(operator.raw_operator, "multi_class"):
          if (
              operator.raw_operator.multi_class == "ovr"
              or operator.raw_operator.solver in ["warn", "liblinear"]
          ):
              multi_class = "ovr"
          elif (
              operator.raw_operator.multi_class == "auto"
              and len(classes) == 2
          ):
              multi_class = "ovr"
          else:
              multi_class = "multinomial"
      if hasattr(operator.raw_operator, "loss"):
          loss = operator.raw_operator.loss
          assert (
              loss in supported_loss
          ), "predict_proba for linear models currently only support {}. (Given {}). Please fill an issue at https://github.com/microsoft/hummingbird".format(
              supported_loss, loss
          )
  
      return LinearModel(
          operator,
          coefficients,
          intercepts,
          device,
          classes=classes,
          multi_class=multi_class,
          loss=loss,
      )
  
imports: import numpy
  from onnxconverter_common.registration import register_converter
  from sklearn._loss.link import LogLink
  from .._linear_implementations import LinearModel
label_desc: Use image node_id 1 for calling a global function with example usage: convert_sklearn_linear_model(operator, device, extra_config) and returns: LinearModel