class_docstr: Ancestor to all operators in this subfolder.
  
  Args:
      onnx_node: `onnx` node
      run_params: additional parameters such as `verbose`, `opsets`
          (it can be more than one if the operator has a subgraph),
          `log` for a logging function
      schema: operator schema
class_docstr_tok: ["Ancestor","to","all","operators","in","this","subfolder",".","Args",":","onnx_node",":","`","onnx","`","node","run_params",":","additional","parameters","such","as","`","verbose","`",",","`","opsets","`","(","it","can","be","more","than","one","if","the","operator","has","a","subgraph",")",",","`","log","`","for","a","logging","function","schema",":","operator","schema"]
docstr: Checks and loads attributes.
docstr_tok: ["Checks","and","loads","attributes","."]
code: def _load_attributes(self) -> None:
      """Checks and loads attributes."""
      self.has_linked_attribute = False
      added_attributes = []
      for att in self.onnx_node.attribute:
          name = att.name
          if att.ref_attr_name:
              value = RefAttrName(att.ref_attr_name)
              self.has_linked_attribute = True
          else:
              value = self._extract_attribute_value(att)
          setattr(self, name, value)
          added_attributes.append(name)
          if att.type == AttributeProto.GRAPH:
              self.has_subgraph = True
              self.has_linked_attribute |= value.has_linked_attribute  # type: ignore
              setattr(
                  self,
                  f"_run_{att.name}",
                  lambda context, value=value, attributes=None: OpRun._evaluate_subgraph(
                      context, value, attributes
                  ),
              )
  
      if self._schema and self.onnx_node.op_type not in {"Constant"}:
          for k, v in self._schema.attributes.items():  # type: ignore
              if not hasattr(self, k):
                  if getattr(v, "required", True):
                      raise RuntimeError(
                          f"Attribute {k!r} is expected based on ONNX specifications "
                          f"for node {self.onnx_node.op_type!r}."
                      )
                  if hasattr(v, "default_value"):
                      if v.default_value.type == 0 or (
                          v.default_value.type == 4  # noqa: PLR2004
                          and v.default_value.t.data_type == 0
                      ):
                          # default value is undefined, it depends on the inputs
                          value = None  # type: ignore
                      else:
                          value = self._extract_attribute_value(
                              v.default_value, v
                          )
                      setattr(self, k, value)
                      added_attributes.append(k)
      self.attributes_names_ = set(added_attributes)
  
imports: from __future__ import annotations
  import abc
  from typing import Any, ClassVar, Iterable
  import numpy
  from onnx import TensorProto
  from onnx.defs import get_all_schemas_with_history, get_schema, onnx_opset_version
  from onnx.helper import make_node, make_tensor_type_proto, np_dtype_to_tensor_dtype
  from onnx.numpy_helper import to_array, unpack_int4
  from onnx.onnx_pb import AttributeProto, GraphProto, NodeProto, TypeProto
  from onnx.reference.custom_element_types import bfloat16, float8e4m3fn, float8e4m3fnuz, float8e5m2, float8e5m2fnuz, int4, uint4
label_desc: Use image node_id 5 for calling the OpRun obj's underlying member method code with example usage: obj._load_attributes() without return types