code: def convert_onnx_linear_regression_model(
      operator, device, extra_config
  ):
      """
      Converter for `ai.onnx.ml.LinearRegression`
      Args:
          operator: An operator wrapping a `ai.onnx.ml.LinearRegression` 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"
  
      coefficients = intercepts = None
      for attr in operator.raw_operator.origin.attribute:
          if attr.name == "coefficients":
              coefficients = np.array(
                  [
                      [np.array(val).astype("float32")]
                      for val in attr.floats
                  ]
              ).astype("float32")
          elif attr.name == "intercepts":
              intercepts = np.array(attr.floats).astype("float32")
  
      if any(v is None for v in [coefficients, intercepts]):
          raise RuntimeError(
              "Error parsing LinearRegression, found unexpected None"
          )
  
      return LinearModel(
          operator,
          coefficients,
          intercepts,
          device,
          is_linear_regression=True,
      )
  
imports: import numpy
  from onnxconverter_common.registration import register_converter
  from .._linear_implementations import LinearModel
label_desc: Use image node_id 2 for calling a global function with example usage: convert_onnx_linear_regression_model(operator, device, extra_config) and returns: LinearModel