| 41 | } |
| 42 | |
| 43 | void CostAnalyzer::PredictCosts(CostEstimator* cost_estimator, |
| 44 | CostGraphDef* cost_graph, int64* total_time) { |
| 45 | TF_CHECK_OK(cost_estimator->Initialize(*item_)); |
| 46 | RunMetadata run_metadata; |
| 47 | Costs costs; |
| 48 | const Status status = |
| 49 | cost_estimator->PredictCosts(item_->graph, &run_metadata, &costs); |
| 50 | if (cost_graph) { |
| 51 | cost_graph->Swap(run_metadata.mutable_cost_graph()); |
| 52 | } |
| 53 | *total_time = costs.execution_time.count(); |
| 54 | if (!status.ok()) { |
| 55 | LOG(ERROR) << "Could not estimate the cost for item " << item_->id << ": " |
| 56 | << status.error_message(); |
| 57 | return; |
| 58 | } |
| 59 | } |
| 60 | |
| 61 | void CostAnalyzer::GatherCosts() { |
| 62 | CostGraphDef cost_graph_measured; |
nothing calls this directly
no test coverage detected