code: def test_loop_with_different_initializer_input_below_ir4(
      self,
  ) -> None:
      # This is for testing IR<4: tensors must exist both in initializer and input
      # Testing an optional input which does not exist in initializers
      # Checker should throw an error said the missing input is not in initializers
  
      model = helper.make_model(
          opset_imports=[helper.make_operatorsetid("", 8)],
          ir_version=3,
          graph=helper.make_graph(
              name="test-loop",
              inputs=[
                  helper.make_tensor_value_info(
                      "input_0", TensorProto.INT32, shape=[1]
                  ),
                  helper.make_tensor_value_info(
                      "while_maximum_iterations_0",
                      TensorProto.INT64,
                      shape=[],
                  ),
                  helper.make_tensor_value_info(
                      "const_fold_opt__18", TensorProto.INT64, shape=[1]
                  ),
                  helper.make_tensor_value_info(
                      "const_fold_opt__17", TensorProto.FLOAT, shape=[]
                  ),
                  helper.make_tensor_value_info(
                      "Const_0", TensorProto.INT32, shape=[1]
                  ),
              ],
              outputs=[
                  helper.make_tensor_value_info(
                      "output_0", TensorProto.INT32, shape=[1]
                  )
              ],
              initializer=[
                  numpy_helper.from_array(
                      np.array(9223372036854775807, dtype=np.int64),
                      name="while_maximum_iterations_0",
                  ),
                  numpy_helper.from_array(
                      np.array([-1], dtype=np.int64),
                      name="const_fold_opt__18",
                  ),
                  numpy_helper.from_array(
                      np.array(10.0, dtype=np.float32),
                      name="const_fold_opt__17",
                  ),
                  numpy_helper.from_array(
                      np.array([1], dtype=np.int32), name="Const_0"
                  ),
              ],
              nodes=[
                  helper.make_node(
                      "Cast",
                      inputs=["input_0"],
                      outputs=["while_cond_158_while_Less__13_0"],
                      name="while_cond_158_while_Less__13",
                      domain="",
                      to=TensorProto.FLOAT,
                  ),
                  helper.make_node(
                      "Less",
                      inputs=[
                          "while_cond_158_while_Less__13_0",
                          "const_fold_opt__17",
                      ],
                      outputs=["while_cond_158_while_Less_0"],
                      name="while_cond_158_while_Less",
                      domain="",
                  ),
                  helper.make_node(
                      "Squeeze",
                      inputs=["while_cond_158_while_Less_0"],
                      outputs=["while_cond_158_while_Squeeze_0"],
                      name="while_cond_158_while_Squeeze",
                      domain="",
                  ),
                  helper.make_node(
                      "Loop",
                      inputs=[
                          "while_maximum_iterations_0",
                          "while_cond_158_while_Squeeze_0",
                          "input_0",
                          "Const_0",
                      ],
                      outputs=["while_loop_0", "while_loop_1"],
                      name="while_loop",
                      body=helper.make_graph(
                          name="while_body",
                          inputs=[
                              helper.make_tensor_value_info(
                                  "while_while_loop_counter_0",
                                  TensorProto.INT64,
                                  shape=[],
                              ),
                              helper.make_tensor_value_info(
                                  "cond__15_0",
                                  TensorProto.BOOL,
                                  shape=[],
                              ),
                              helper.make_tensor_value_info(
                                  "while_placeholder_0",
                                  TensorProto.INT32,
                                  shape=[1],
                              ),
                              helper.make_tensor_value_info(
                                  "while_add_const_0_0",
                                  TensorProto.INT32,
                                  shape=[1],
                              ),
                              # The following input cannot be found in initializer and checker should throw an error
                              helper.make_tensor_value_info(
                                  "const_fold_opt__18",
                                  TensorProto.FLOAT,
                                  shape=[],
                              ),
                          ],
                          outputs=[
                              helper.make_tensor_value_info(
                                  "cond___while_Identity_graph_outputs_Identity__3_0",
                                  TensorProto.BOOL,
                                  shape=[],
                              ),
                              helper.make_tensor_value_info(
                                  "while_Identity_2_0",
                                  TensorProto.INT32,
                                  shape=[1],
                              ),
                              helper.make_tensor_value_info(
                                  "while_add_const_0_0",
                                  TensorProto.INT32,
                                  shape=[1],
                              ),
                          ],
                          initializer=[],
                          nodes=[
                              helper.make_node(
                                  "Add",
                                  inputs=[
                                      "while_placeholder_0",
                                      "while_add_const_0_0",
                                  ],
                                  outputs=["while_Identity_2_0"],
                                  name="while_Add",
                              ),
                              helper.make_node(
                                  "Cast",
                                  inputs=["while_Identity_2_0"],
                                  outputs=["cond___while_Less__13_0"],
                                  name="cond___while_Less__13",
                                  domain="",
                                  to=TensorProto.FLOAT,
                              ),
                          ],
                      ),
                  ),
                  helper.make_node(
                      "Unsqueeze",
                      inputs=["while_loop_0"],
                      outputs=["Reshape_tensor_0"],
                      name="Reshape_tensor",
                      axes=[0],
                  ),
                  helper.make_node(
                      "Reshape",
                      inputs=["Reshape_tensor_0", "const_fold_opt__18"],
                      outputs=["output_0"],
                      name="Reshape",
                  ),
              ],
          ),
      )
      self.assertRaises(
          shape_inference.InferenceError,
          checker.check_model,
          model,
          True,
      )
  
imports: import os
  import tempfile
  import unittest
  from typing import Sequence
  import numpy
  import onnx.defs
  import onnx.parser
  from onnx import GraphProto, SparseTensorProto, TensorProto, checker, helper, numpy_helper, shape_inference
label_desc: Use image node_id 39 for calling the TestChecker obj's underlying member method code with example usage: obj.test_loop_with_different_initializer_input_below_ir4() without return types