def choose_meta_graph_def_and_raise(saved_model):
  """Find a MetaGraphDef in the SavedModel with tag `constants.TRANSFORM_TAG`.

  Args:
    saved_model: A `SavedModel` protocol buffer.

  Returns:
    The chosen `MetaGraphDef` protocol buffer.  This can be used to further
    extract signature-defs, collection-defs, etc.

  Raises:
    RuntimeError: MetaGraphDef associated with the tags cannot be found.
  """
  result = choose_meta_graph_def(saved_model)

  if result is None:
    raise RuntimeError(
        'MetaGraphDef associated with tags {} could not be found in SavedModel'
        .format(constants.TRANSFORM_TAG))

  return result
Find a MetaGraphDef in the SavedModel with tag `constants.TRANSFORM_TAG`.

  Args:
    saved_model: A `SavedModel` protocol buffer.

  Returns:
    The chosen `MetaGraphDef` protocol buffer.  This can be used to further
    extract signature-defs, collection-defs, etc.

  Raises:
    RuntimeError: MetaGraphDef associated with the tags cannot be found.
  
tensorflow_transform/saved/saved_model_loader.py