message: SavedModel tag logging.
diff: @@ -62,6 +62,15 @@ Status ReadSavedModel(const string& export_dir, SavedModel* saved_model_proto) {
  export_dir);
  }
  +string GetTagsAsString(const std::unordered_set<string>& tags) {
  + string tags_as_string = "{ ";
  + for (const string& tag : tags) {
  + tags_as_string = strings::StrCat(tags_as_string, tag, " ");
  + }
  + tags_as_string = strings::StrCat(tags_as_string, "}");
  + return tags_as_string;
  +}
  +
  Status FindMetaGraphDefToLoad(const SavedModel& saved_model_proto,
  const std::unordered_set<string>& tags,
  MetaGraphDef* meta_graph_def_to_load) {
  @@ -77,14 +86,9 @@ Status FindMetaGraphDefToLoad(const SavedModel& saved_model_proto,
  return Status::OK();
  }
  }
  - string tags_as_string = "{ ";
  - for (const string& tag : tags) {
  - tags_as_string = strings::StrCat(tags_as_string, tag, " ");
  - }
  - tags_as_string = strings::StrCat(tags_as_string, "}");
  return Status(error::Code::NOT_FOUND,
  "Could not find meta graph def matching supplied tags: " +
  - tags_as_string +
  + GetTagsAsString(tags) +
  ". To inspect available tag-sets in the SavedModel, please "
  "use the SavedModel CLI: `saved_model_cli`");
  }
  @@ -233,7 +237,8 @@ Status LoadSavedModelInternal(const SessionOptions& session_options,
  return Status(error::Code::NOT_FOUND,
  "SavedModel not found in export directory: " + export_dir);
  }
  - LOG(INFO) << "Loading SavedModel from: " << export_dir;
  + LOG(INFO) << "Loading SavedModel with tags: " << GetTagsAsString(tags)
  + << "; from: " << export_dir;
  SavedModel saved_model_proto;
  TF_RETURN_IF_ERROR(ReadSavedModel(export_dir, &saved_model_proto));
  @@ -281,7 +286,8 @@ Status LoadSavedModel(const SessionOptions& session_options,
  return end_microseconds - start_microseconds;
  }();
  auto log_and_count = [&](const string& status_str) {
  - LOG(INFO) << "Loading SavedModel: " << status_str << ". Took "
  + LOG(INFO) << "SavedModel load for tags " << GetTagsAsString(tags)
  + << "; Status: " << status_str << ". Took "
  << load_latency_microsecs << " microseconds.";
  load_attempt_count->GetCell(export_dir, status_str)->IncrementBy(1);
  };
  