code: def infer_node_outputs(
      schema: onnx.defs.OpSchema,
      node: onnx.NodeProto,
      input_types: Dict[str, onnx.TypeProto],
      input_data: Optional[Dict[str, onnx.TensorProto]] = None,
      input_sparse_data: Optional[
          Dict[str, onnx.SparseTensorProto]
      ] = None,
      opset_imports: Optional[List[onnx.OperatorSetIdProto]] = None,
      ir_version: int = onnx.IR_VERSION,
  ) -> Dict[str, onnx.TypeProto]:
      if not schema.has_type_and_shape_inference_function:  # type: ignore
          return {}
      if input_data is None:
          input_data = {}
      if input_sparse_data is None:
          input_sparse_data = {}
      if opset_imports is None:
          passed_opset_imports = {}
      else:
          passed_opset_imports = {
              opset.domain: opset.version for opset in opset_imports
          }
  
      # catch KeyError if node's input does not exist in input_types
      passed_input_types = {
          key: input_types[key].SerializeToString()
          for key in node.input
      }
      # input_types will also be used as outer_scope_value_types so do not filter by node's input here
      for key in input_types:
          if key not in passed_input_types:
              passed_input_types[key] = input_types[
                  key
              ].SerializeToString()
      passed_input_data = {
          key: input_data[key].SerializeToString()
          for key in node.input
          if key in input_data
      }
      passed_sparse_input_data = {
          key: input_sparse_data[key].SerializeToString()
          for key in node.input
          if key in input_sparse_data
      }
  
      outputs = schema._infer_node_outputs(  # pylint: disable=protected-access
          node.SerializeToString(),
          passed_input_types,
          passed_input_data,
          passed_sparse_input_data,
          passed_opset_imports,
          ir_version,
      )  # type: ignore[call-arg]
      return {
          key: onnx.TypeProto.FromString(out)
          for key, out in outputs.items()
      }
  
file_path: catboost/contrib/libs/onnx/onnx/shape_inference.py
imports: from typing import Dict, List, Optional, Sequence, Union
  import onnx
  from onnx.onnx_cpp2py_export import shape_inference
  from onnx import AttributeProto, FunctionProto, ModelProto, TypeProto
label_desc: Use image node_id 3 for calling a global function with example usage: infer_node_outputs(schema, node, input_types, input_data, input_sparse_data, opset_imports, ir_version) and returns: unknown, dict