CostGraphDef has been modified to keep track of the accuracy of the cost estimation.

PiperOrigin-RevId: 200078367
This commit is contained in:
A. Unique TensorFlower 2018-06-11 10:59:30 -07:00 committed by TensorFlower Gardener
parent 6aeab4f540
commit 20a8e604e3
2 changed files with 4 additions and 0 deletions

View File

@ -69,6 +69,9 @@ message CostGraphDef {
// Ids of the control inputs for this node.
repeated int32 control_input = 8;
// Are the costs inaccurate?
bool inaccurate = 17;
}
repeated Node node = 1;
}

View File

@ -98,6 +98,7 @@ Status AnalyticalCostEstimator::PredictCosts(const GraphDef& optimized_graph,
node_costs.compute_time.asMicroSeconds().count());
cost_node->set_memory_time(
node_costs.memory_time.asMicroSeconds().count());
cost_node->set_inaccurate(node_costs.inaccurate);
for (const auto& output : op_context.op_info.outputs()) {
auto output_info = cost_node->add_output_info();
output_info->set_dtype(output.dtype());