docstr: Check that the model inference infers the expected types for outputs.
  Restricted to the simple case of tensor types, so expected types specify
  only the element type (ints corresponding to onnx.TensorProto.DataType).
docstr_tok: ["Check","that","the","model","inference","infers","the","expected","types","for","outputs",".","Restricted","to","the","simple","case","of","tensor","types",",","so","expected","types","specify","only","the","element","type","(","ints","corresponding","to","onnx.TensorProto.DataType",")","."]
code: def _check(self, model_text: str, *expected: int):
      """Check that the model inference infers the expected types for outputs.
      Restricted to the simple case of tensor types, so expected types specify
      only the element type (ints corresponding to onnx.TensorProto.DataType).
      """
      model = onnx.parser.parse_model(model_text)
      inferred = onnx.shape_inference.infer_shapes(model)
      outputs = inferred.graph.output
      for output, expected_elem_type in zip(outputs, expected):
          inferred_type = output.type
          self.assertTrue(inferred_type.HasField("tensor_type"))
          tensor_type = inferred_type.tensor_type
          self.assertTrue(tensor_type.HasField("elem_type"))
          elem_type = tensor_type.elem_type
          self.assertEqual(elem_type, expected_elem_type)
  
file_path: onnx/onnx/test/model_inference_test.py
imports: import typing
  import unittest
  import onnx
  import onnx.parser
  import onnx.shape_inference
label_desc: Use image node_id 1 for calling the TestModelInference obj's underlying member method code with example usage: obj._check(model_text) without return types