code: def __init__(self, onnx_node, run_params):  # type: ignore
      ConstantCommon.__init__(self, onnx_node, run_params)
      if hasattr(self, "sparse_value") and self.sparse_value is not None:  # type: ignore
          self.cst_name = "sparse_value"
          self.cst = self.sparse_value  # type: ignore
          self.cst_convert = lambda v: v
      elif hasattr(self, "value") and self.value is not None:  # type: ignore
          self.cst_name = "value"  # type: ignore
          self.cst = self.value if isinstance(self.value, RefAttrName) else self.value  # type: ignore
          self.cst_convert = lambda v: v
      else:
          for attr, np_dtype in {
              "value_float": np.float32,
              "value_floats": np.float32,
              "value_int": np.int64,
              "value_ints": np.int64,
              "value_string": np.str_,
              "value_strings": np.str_,
          }.items():
              if hasattr(self, attr) and getattr(self, attr) is not None:  # type: ignore
                  self.cst_name = attr
                  v = getattr(self, attr)
                  self.cst = (
                      v  # type: ignore
                      if isinstance(v, RefAttrName)  # type: ignore
                      else np.array(v, dtype=np_dtype)  # type: ignore
                  )
                  self.cst_convert = lambda v, np_dtype=np_dtype: np.array(  # type: ignore
                      v, dtype=np_dtype
                  )
                  break
      if not hasattr(self, "cst_name"):
          raise AttributeError(
              f"No constant is defined for operator 'Constant', outputs are {onnx_node.output}."
          )
  
imports: import numpy
  from onnx.reference.custom_element_types import bfloat16, float8e4m3fn, float8e4m3fnuz, float8e5m2, float8e5m2fnuz, int4, uint4
  from onnx.reference.op_run import OpRun, RefAttrName
label_desc: Use image node_id 1 to create a new Constant_12 object from inherited base classes: ConstantCommon with example: obj = Constant_12(onnx_node, run_params)