class_docstr: Runs a custom function.
class_docstr_tok: ["Runs","a","custom","function","."]
code: def __init__(
      self,
      onnx_node: NodeProto,
      run_params: dict[str, Any] | None,
      impl: Any = None,
      attributes: dict[str, Any] | None = None,
  ):
      if impl is None:
          raise RuntimeError(
              f"impl cannot be None for node type {onnx_node.op_type!r} "
              f"from domain {onnx_node.domain!r}."
          )
      OpRun.__init__(self, onnx_node, run_params)  # type: ignore[arg-type]
      self.impl_ = impl
      # The function implementation is the same whenever the function is called
      # but the attributes may be different at every call.
      self.attributes_ = {
          name: getattr(self, name)
          for name in getattr(self.impl_, "attributes_", attributes)  # type: ignore[union-attr]
      }
  
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 1 to create a new OpFunction object from inherited base classes: OpRun with example: obj = OpFunction(onnx_node, run_params, impl, attributes)