code: def _make_coreml_output_features(
      graph, forceShape=False, disable_coreml_rank5_mapping=False
  ):  # type: (...) -> Sequence[Tuple[Text, datatypes.Array]]
      features = []
      outputs = graph.outputs
      op_types = graph.blob_from_op_type
      ops_allowing_zerod_output = {"Size"}
  
      for output_ in outputs:
          if (
              op_types[output_[0]] in ops_allowing_zerod_output
              and len(output_[2]) == 0
          ):
              output_ = list(output_)
              output_[2] = (1,)
  
          if disable_coreml_rank5_mapping:
              shape = output_[2]
              if len(shape) > 5:
                  raise ValueError(
                      "ONNX output %s has a rank greater than 5, which is not supported in CoreML framework"
                      % str(output_[0])
                  )
              else:
                  features.append(
                      (str(output_[0]), datatypes.Array(*shape))
                  )
              continue
  
          if not forceShape:
              features.append((str(output_[0]), None))
          else:
              shape = output_[2]
              if len(shape) == 0:
                  shape = [1, 1, 1]
              elif len(shape) == 1:
                  pass
              elif len(shape) == 3:
                  if (
                      output_[0] in op_types
                      and str(op_types[output_[0]])
                      in _SEQUENCE_LAYERS_REGISTRY
                  ):
                      # onnx shape: (Seq,B,C)
                      shape = [shape[2]]
              elif len(shape) == 4:  # (B,C,H,W) --> (C,H,W)
                  shape = shape[1:]
              else:
                  shape = None  # output shape need not be specified for CoreML.
              if shape is None:
                  features.append((str(output_[0]), shape))
              else:
                  features.append(
                      (str(output_[0]), datatypes.Array(*shape))
                  )
      return features
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  from __future__ import unicode_literals
  from typing import Text, Union, Optional, Dict, Any, Iterable, Sequence, Callable, List
  import numpy
  from coremltools._deps import _HAS_ONNX
  from coremltools.models.neural_network import NeuralNetworkBuilder
  from coremltools.models import datatypes, MLModel
  from coremltools.proto import FeatureTypes_pb2
  from coremltools import _MINIMUM_CUSTOM_LAYER_SPEC_VERSION
  from coremltools import _MINIMUM_CUSTOM_MODEL_SPEC_VERSION
  from coremltools import _MINIMUM_NDARRAY_SPEC_VERSION
  from coremltools import __version__
  from coremltools.models import _METADATA_VERSION, _METADATA_SOURCE
  from typing import Tuple
  from ._operators import _convert_node, _SEQUENCE_LAYERS_REGISTRY, _ONNX_NODE_REGISTRY, _add_const_inputs_if_required
  from ._operators_nd import _ONNX_NODE_REGISTRY_ND, _convert_node_nd
  from ._graph import Graph, EdgeInfo, Transformer
  from ._transformers import ConvAddFuser, DropoutRemover, ReshapeInitTensorFuser, BNBroadcastedMulFuser, BNBroadcastedAddFuser, PixelShuffleFuser, OutputRenamer, AddModelInputsOutputs, ConstantsToInitializers, ImageScalerRemover, ShapeOpRemover, ConstantRemover, ConstantFillToInitializers, ReshapeTransposeReshape_pattern1, CastOpRemover, DeadCodeElimination, PaddingOpRemover
  from coremltools.converters.mil.backend.nn.passes.mlmodel_passes import remove_disconnected_layers, transform_conv_crop
  from ._error_utils import ErrorHandling
  from ._graph_viz import plot_graph
label_desc: Use image node_id 2 for calling a global function with example usage: _make_coreml_output_features(graph, forceShape, disable_coreml_rank5_mapping) and returns: features