| 225 | |
| 226 | |
| 227 | void StatSummarizer::PrintOutputs() const { |
| 228 | std::priority_queue< |
| 229 | std::pair<int64, const std::pair<const std::string, Detail>*>> |
| 230 | timings; |
| 231 | for (const auto& entry : stats_calculator_->GetDetails()) { |
| 232 | timings.emplace(-entry.second.start_us.avg(), &entry); |
| 233 | } |
| 234 | |
| 235 | LOG(INFO) << "============ Node output tensor sizes in run order ========"; |
| 236 | while (!timings.empty()) { |
| 237 | auto entry = timings.top(); |
| 238 | timings.pop(); |
| 239 | std::stringstream stream; |
| 240 | const auto detail_outputs = outputs_.at(entry.second->first); |
| 241 | stream << entry.second->first << "\t" << detail_outputs.size(); |
| 242 | for (const auto& tensor : detail_outputs) { |
| 243 | stream << "\t" << DataTypeString(tensor.dtype()); |
| 244 | stream << "\t" << tensor.shape().dim_size(); |
| 245 | for (const auto& d : tensor.shape().dim()) { |
| 246 | stream << "\t" << d.size(); |
| 247 | } |
| 248 | } |
| 249 | LOG(INFO) << stream.str(); |
| 250 | } |
| 251 | } |
| 252 | |
| 253 | } // namespace tensorflow |