code: def test_fi_optional_input(self):
      code = """
              <opset_import: [ "" : 18 ], domain: "local">
              DoReduce (x, axes) => (y) {
                  y = ReduceMax (x, axes)
              }
          """
      # We can omit the type for a missing trailing optional parameter
      self._check(code, [float_type_], [], [float_type_])
      # Or, we can pass in a default-value of TypeProto() for a missing optional parameter
      self._check(code, [float_type_, no_type_], [], [float_type_])
  
      code = """
              <opset_import: [ "" : 18 ], domain: "local">
              Quantize (x, scale, zero_point) => (y) {
                  y = QuantizeLinear (x, scale, zero_point)
              }
          """
      # If the optional third parameter is specified, it determines the output type.
      self._check(
          code, [float_type_, float_type_, int8_type_], [], [int8_type_]
      )
      self._check(
          code,
          [float_type_, float_type_, uint8_type_],
          [],
          [uint8_type_],
      )
      # If the optional third parameter is omitted, the output type is uint8 (default).
      self._check(
          code, [float_type_, float_type_, no_type_], [], [uint8_type_]
      )
  
      code = """
              <opset_import: [ "" : 18 ], domain: "local">
              DoClip (x, min, max) => (y) {
                  y = Clip (x, min, max)
              }
          """
      # A test-case with a non-trailing missing optional parameter
      self._check(
          code, [float_type_, no_type_, float_type_], [], [float_type_]
      )
  
      # A failing test-case with a non-trailing missing optional parameter
      self._check_fails(code, [float_type_, no_type_, int8_type_], [])
  
file_path: onnx/onnx/test/function_inference_test.py
imports: import unittest
  from typing import Sequence
  from shape_inference_test import TestShapeInferenceHelper
  import onnx
  import onnx.helper
  import onnx.parser
  import onnx.shape_inference
  from onnx import AttributeProto, TypeProto
label_desc: Use image node_id 5 for calling the TestFunctionInference obj's underlying member method code with example usage: obj.test_fi_optional_input() without return types