Returns the cost of running the specified item. Args: item: The item for which to measure the costs. Returns: The triplet op_perfs, runtime, step_stats.
(self, item)
| 86 | return tf_cluster.TF_EstimatePerformance(device.SerializeToString()) |
| 87 | |
| 88 | def MeasureCosts(self, item): |
| 89 | """Returns the cost of running the specified item. |
| 90 | |
| 91 | Args: |
| 92 | item: The item for which to measure the costs. |
| 93 | Returns: The triplet op_perfs, runtime, step_stats. |
| 94 | """ |
| 95 | ret_from_swig = tf_cluster.TF_MeasureCosts(item.tf_item, self._tf_cluster, |
| 96 | self._generate_timeline) |
| 97 | |
| 98 | if ret_from_swig is None: |
| 99 | return None |
| 100 | |
| 101 | op_perf_bytes_list, run_time, step_stats_bytes = ret_from_swig |
| 102 | op_perfs = [op_performance_data_pb2.OpPerformance.FromString(op_perf_bytes) |
| 103 | for op_perf_bytes in op_perf_bytes_list] |
| 104 | return (op_perfs, run_time, |
| 105 | step_stats_pb2.StepStats.FromString(step_stats_bytes)) |
| 106 | |
| 107 | def DeterminePeakMemoryUsage(self, item): |
| 108 | """Returns a snapshot of the peak memory usage. |
no outgoing calls