code: def _get_all_tensors(
      onnx_model_proto: ModelProto,
  ) -> Iterable[TensorProto]:
      """Scan an ONNX model for all tensors and return as an iterator."""
      return chain(
          _get_initializer_tensors(onnx_model_proto),
          _get_attribute_tensors(onnx_model_proto),
      )
  
imports: import os
  import re
  import sys
  import uuid
  from itertools import chain
  from typing import Callable, Iterable, Optional
  from onnx.onnx_pb import AttributeProto, GraphProto, ModelProto, TensorProto
label_desc: Use image node_id 7 for calling a global function with example usage: _get_all_tensors(onnx_model_proto) and returns: chain