class_docstr: The OnnxSchemaChecker class is a checker for ONNX OpSchema and param schema.
  
  It provides methods to check for input compatibility based on the OpSchema. It also
  provides a matching score to indicate how well the OpSchema matches the input and
  kwargs types. A function will be evaluated as perfect match, nearest match eligible,
  or no match.
  
  Here are some common examples in categories:
  
  1. [NOTE: Perfect match]: The number of inputs and attributes are exactly the same as
      the OpSchema. The types of inputs and attributes are exactly the same as the
      OpSchema.
  
      ```python
      inputs = (Tensor[2, 3], Tensor[2, 3])
      attributes = {"alpha": 1.0}
  
      @torch_op("aten::op")
      def aten_op(self: TReal, other: TReal, alpha: float = 1) -> TReal:
          ...
  
      ```
      Result: Perfect match.
  
  2. [NOTE: Optional input]: The dispatcher recognizes optional inputs. However,
      the input can't be ignored. None must be provided.
  
      ```python
      inputs = (Tensor([2, 3]), None)
      attributes = {}
  
      aten_op(X: TTensor, Y: Optional[INT64]):
          ...
      ```
      Result: Perfect match.
      Real example: `aten::convolution`.
  
  3. [NOTE: Different attributes]: If an attribute is provided with value, it's
      a must to match the attribute in function signature.
      ```python
      inputs = (Tensor([2, 3]),)
      attributes = {"a":1, "b":2}
  
      aten_op(X: TTensor, a: int):
          ...
      ```
      Result: No match.
      Real example: `aten::div` vs `aten::div.Tensor_mode`.
  
  4. [NOTE: Default attributes]: Default attribute will fill in the value into
      inputs/attributes.
      ```python
      inputs = (Tensor([2, 3]),)
      attributes = {}
  
      aten_op(X: TTensor, a: int = 3):
          ...
      ```
      Result: Perfect match.
      Real example: `aten::clone`
  
  5. [NOTE: Ignore attribute with None value]: The attributes with None value
      will be ignored in matching.
      ```python
      inputs = (Tensor([2, 3]),)
      attributes = {"a": None}
  
      aten_op(X: TTensor):
          ...
      ```
      Result: Perfect match.
  
      ```python
      inputs = (Tensor([2, 3]),)
      attributes = {"a": None}
  
      aten_op(X: TTensor, a: int = 3):
          ...
      ```
      Result: Nearest match eligible.
  
      Real example: `aten::div` vs `aten::div.Tensor_mode`.
  
  Attributes:
      onnxfunction: The OnnxFunction.
      param_schema: The parameter schema defined in the OnnxFunction.
      op_schema: The ONNX OpSchema.
      type_constraints: The type constraints defined in the OpSchema.
      attributes: The attributes defined in the OpSchema.
      _matching_score: The matching score of the OnnxSchemaChecker .
code: def _match_onnx_attribute_type(
      self,
      attribute_name: str,
      attribute: Union[
          fx_type_utils.Argument,
          onnxscript_graph_building.TorchScriptTensor,
      ],
      is_sequence: bool = False,
  ) -> bool:
      if isinstance(attribute, (int, float, bool, str)):
          attribute_onnx_type = (
              fx_type_utils.from_python_type_to_onnx_attribute_type(
                  type(attribute), is_sequence=is_sequence
              )
          )
          if (
              attribute_onnx_type
              != self.attributes[attribute_name].type
          ):
              return False
      # If the attribute is an empty list, we don't know the type of the list
      # so it's a mismatch
      elif isinstance(attribute, (list, tuple)) and attribute:
          return self._match_onnx_attribute_type(
              attribute_name, attribute[0], is_sequence=True
          )
      else:
          # NOTE: Unrecognized attribute type
          return False
      return True
  
imports: from __future__ import annotations
  import logging
  import operator
  import types
  from typing import Any, Callable, Dict, List, Optional, Sequence, Set, Tuple, TYPE_CHECKING, Union
  import torch
  import torch._ops
  import torch.fx
  from torch.onnx._internal import _beartype
  from torch.onnx._internal.fx import diagnostics, registration, type_utils
  from onnxscript.function_libs.torch_lib import graph_building
label_desc: Use image node_id 4 for calling the _OnnxSchemaChecker obj's underlying member method code with example usage: obj._match_onnx_attribute_type(attribute_name, attribute, is_sequence) and returns: True, False, self, False