diff options
Diffstat (limited to 'tensorflow/core/grappler/costs/virtual_scheduler.cc')
-rw-r--r-- | tensorflow/core/grappler/costs/virtual_scheduler.cc | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/tensorflow/core/grappler/costs/virtual_scheduler.cc b/tensorflow/core/grappler/costs/virtual_scheduler.cc index 7f68272950..6a1b0aebfa 100644 --- a/tensorflow/core/grappler/costs/virtual_scheduler.cc +++ b/tensorflow/core/grappler/costs/virtual_scheduler.cc @@ -30,6 +30,7 @@ limitations under the License. #include "tensorflow/core/lib/core/errors.h" #include "tensorflow/core/lib/strings/numbers.h" #include "tensorflow/core/lib/strings/str_util.h" +#include "tensorflow/core/lib/strings/stringprintf.h" #include "tensorflow/core/platform/logging.h" #include "tensorflow/core/util/device_name_utils.h" @@ -858,8 +859,9 @@ Costs VirtualScheduler::Summary() const { const auto& memory_cost = op_cost_pair.second.memory_time.count(); const bool is_op_cost_accurate = !op_cost_pair.second.inaccurate; if (cost) { // Skip printing out zero-cost ops. - VLOG(1) << " + " << op << " : " << (is_op_cost_accurate ? "" : "~") - << cost << " / " << compute_cost << " / " << memory_cost; + VLOG(1) << strings::Printf(" + %30s : %c %10ld / %10ld / %10ld", + op.c_str(), (is_op_cost_accurate ? ' ' : '~'), + cost, compute_cost, memory_cost); } } @@ -934,9 +936,11 @@ Costs VirtualScheduler::Summary() const { : 0.0; if (cost || mem_usage_percent > 1.0) { // Print out only non-zero cost ops or ops with > 1% memory usage. - VLOG(1) << " + " << op << " : " << (is_op_cost_accurate ? "" : "~") - << cost << " / " << compute_cost << " / " << memory_cost << " (" - << strings::HumanReadableNumBytes(op_mem_usage) << " [" + VLOG(1) << strings::Printf(" + %30s : %c %10ld / %10ld / %10ld", + op.c_str(), + (is_op_cost_accurate ? ' ' : '~'), cost, + compute_cost, memory_cost) + << " (" << strings::HumanReadableNumBytes(op_mem_usage) << " [" << mem_usage_percent << "%] " << (persisent_ops.count(op) > 0 ? ": persistent op)" : ")"); } |