message: Avoid potential undefined behavior
diff: @@ -198,8 +198,9 @@ void TFStats::AddGraph(std::unique_ptr<GraphDef> graph) {
  continue;
  }
  node_added = true;
  + size_t num_nodes = nodes_map_.size();
  nodes_map_[node.name()] = std::unique_ptr<TFGraphNode>(
  - new TFGraphNode(&node, nodes_map_.size(), &nodes_map_));
  + new TFGraphNode(&node, num_nodes, &nodes_map_));
  node_defs[node.name()] = &node;
  }
  for (auto it = node_defs.begin(); it != node_defs.end(); it++) {
  @@ -292,8 +293,9 @@ void TFStats::AddRunMeta(int64 step, std::unique_ptr<RunMetadata> run_meta) {
  if (node == nodes_map_.end()) {
  NodeDef def;
  if (CreateRunMetadataNode(name, &def)) {
  + size_t num_nodes = nodes_map_.size();
  nodes_map_[name] = std::unique_ptr<TFGraphNode>(
  - new TFGraphNode(&def, nodes_map_.size(), &nodes_map_));
  + new TFGraphNode(&def, num_nodes, &nodes_map_));
  nodes_map_.at(name)->AddStepStat(step, dev_stat.device(), node_stat);
  }
  } else {
  