message: Handle comma separated list of placholder types in 'optimize_for_inference.py' tool.
diff: @@ -88,7 +88,7 @@ def main(unused_args):
  input_graph_def,
  FLAGS.input_names.split(","),
  FLAGS.output_names.split(","),
  - FLAGS.placeholder_type_enum,
  + _parse_placeholder_types(FLAGS.placeholder_type_enum),
  FLAGS.toco_compatible)
  if FLAGS.frozen_graph:
  @@ -101,6 +101,12 @@ def main(unused_args):
  return 0
  +def _parse_placeholder_types(values):
  + """Extracts placeholder types from a comma separate list."""
  + values = [int(value) for value in values.split(",")]
  + return values if len(values) > 1 else values[0]
  +
  +
  def parse_args():
  """Parses command line arguments."""
  parser = argparse.ArgumentParser()
  @@ -137,9 +143,12 @@ def parse_args():
  """)
  parser.add_argument(
  "--placeholder_type_enum",
  - type=int,
  - default=dtypes.float32.as_datatype_enum,
  - help="The AttrValue enum to use for placeholders.")
  + type=str,
  + default=str(dtypes.float32.as_datatype_enum),
  + help="""\
  + The AttrValue enum to use for placeholders.
  + Or a comma separated list, one value for each placeholder.\
  + """)
  parser.add_argument(
  "--toco_compatible",
  type=bool,
  