code: def add(self, name, value):
      if not name.endswith("_as_tensor"):
          self._names.append(name)
      if isinstance(value, list):
          if name in {
              "base_values",
              "class_weights",
              "nodes_values",
              "nodes_hitrates",
          }:
              value = np.array(value, dtype=np.float32)
          elif name.endswith("as_tensor"):
              value = np.array(value)
      setattr(self, name, value)
  
file_path: onnx/onnx/reference/ops/aionnxml/op_tree_ensemble_helper.py
imports: import numpy
label_desc: Use image node_id 2 for calling the TreeEnsembleAttributes obj's underlying member method code with example usage: obj.add(name, value) without return types