Number of times the graph node is executed. When step < 0, the average number of times executed across all steps.
| 486 | // Number of times the graph node is executed. When step < 0, the |
| 487 | // average number of times executed across all steps. |
| 488 | int64 run_count(int64 step) const { |
| 489 | if (execs_.empty()) { |
| 490 | return 0; |
| 491 | } |
| 492 | if (step >= 0) { |
| 493 | auto exec = execs_.find(step); |
| 494 | if (exec == execs_.end()) { |
| 495 | return 0; |
| 496 | } |
| 497 | return exec->second.run_count(); |
| 498 | } |
| 499 | int64 total_run_count = 0; |
| 500 | for (const auto& exec : execs_) { |
| 501 | total_run_count += exec.second.run_count(); |
| 502 | } |
| 503 | return total_run_count / execs_.size(); |
| 504 | } |
| 505 | // This is overall computation time, including both cpu and accelerator. |
| 506 | // Note, cpu and accelerator might or might not run in parallel. |
| 507 | int64 exec_micros(int64 step) const { |