class_docstr: Bulk inferer executor for inference on AI Platform.
class_docstr_tok: ["Bulk","inferer","executor","for","inference","on","AI","Platform","."]
docstr: Returns a model signature.
docstr_tok: ["Returns","a","model","signature","."]
code: def _get_model_signature(self, model_path: str) -> _SignatureDef:
      """Returns a model signature."""
  
      saved_model_pb = loader_impl.parse_saved_model(model_path)
      meta_graph_def = None
      for graph_def in saved_model_pb.meta_graphs:
          if graph_def.meta_info_def.tags == [
              tf.compat.v1.saved_model.tag_constants.SERVING
          ]:
              meta_graph_def = graph_def
      if not meta_graph_def:
          raise RuntimeError(
              "Tag tf.compat.v1.saved_model.tag_constants.SERVING"
              " does not exist in saved model: %s. This is required"
              " for remote inference." % model_path
          )
      if (
          tf.saved_model.PREDICT_METHOD_NAME
          in meta_graph_def.signature_def
      ):
          return meta_graph_def.signature_def[
              tf.saved_model.PREDICT_METHOD_NAME
          ]
      if (
          tf.saved_model.DEFAULT_SERVING_SIGNATURE_DEF_KEY
          in meta_graph_def.signature_def
      ):
          return meta_graph_def.signature_def[
              tf.saved_model.DEFAULT_SERVING_SIGNATURE_DEF_KEY
          ]
      raise RuntimeError(
          "Cannot find serving signature in saved model: %s,"
          " tf.saved_model.PREDICT_METHOD_NAME or "
          " tf.saved_model.DEFAULT_SERVING_SIGNATURE_DEF_KEY is needed."
          % model_path
      )
  
imports: import hashlib
  import re
  from typing import Any, Dict, List
  from absl import logging
  from google.api_core import client_options
  from googleapiclient import discovery
  import tensorflow
  from tfx import types
  from tfx.components.bulk_inferrer import executor
  from tfx.components.util import model_utils
  from tfx.extensions.google_cloud_ai_platform import constants
  from tfx.extensions.google_cloud_ai_platform import runner
  from tfx.proto import bulk_inferrer_pb2
  from tfx.types import artifact_utils
  from tfx.utils import doc_controls
  from tfx.utils import json_utils
  from tfx.utils import name_utils
  from tfx.utils import path_utils
  from tfx.utils import proto_utils
  from tfx.utils import telemetry_utils
  from tfx_bsl.public.proto import model_spec_pb2
  from tensorflow.python.saved_model import loader_impl
label_desc: Use image node_id 3 for calling the Executor obj's underlying member method code with example usage: obj._get_model_signature(model_path) and returns: meta_graph_def, meta_graph_def