def MeasureCosts(self, item): """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. """ ret_from_swig = tf_cluster.TF_MeasureCosts(item.tf_item, self._tf_cluster, self._generate_timeline) if ret_from_swig is None: return None op_perf_bytes_list, run_time, step_stats_bytes = ret_from_swig op_perfs = [ op_performance_data_pb2.OpPerformance.FromString(op_perf_bytes) for op_perf_bytes in op_perf_bytes_list ] return (op_perfs, run_time, step_stats_pb2.StepStats.FromString(step_stats_bytes))
def MeasureCosts(self, item): """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. """ with errors.raise_exception_on_not_ok_status() as status: ret_from_swig = tf_cluster.TF_MeasureCosts( item.tf_item, self._tf_cluster, self._generate_timeline, status) if ret_from_swig is None: return None op_perf_bytes_list, run_time, step_stats_bytes = ret_from_swig op_perfs = [] for op_perf_bytes in op_perf_bytes_list: op_perfs.append( op_performance_data_pb2.OpPerformance.FromString(op_perf_bytes)) return (op_perfs, run_time, step_stats_pb2.StepStats.FromString(step_stats_bytes))