A single measurement is enough when using simulation
authorBenoit Steiner <bsteiner@google.com>
Fri, 6 Apr 2018 20:49:42 +0000 (13:49 -0700)
committerTensorFlower Gardener <gardener@tensorflow.org>
Fri, 6 Apr 2018 20:51:39 +0000 (13:51 -0700)
PiperOrigin-RevId: 191934781

tensorflow/python/grappler/cluster.i

index 067c821..6816e20 100644 (file)
@@ -320,7 +320,8 @@ static PyObject* TF_MeasureCosts(
   tensorflow::OpPerformanceList op_performance_data;
   tensorflow::StepStats step_stats;
 
-  tensorflow::grappler::MeasuringCostEstimator cost_measure(cluster.get(), 10, 0);
+  const int num_measurements = cluster->type() == "virtual" ? 1 : 10;
+  tensorflow::grappler::MeasuringCostEstimator cost_measure(cluster.get(), num_measurements, 0);
 
   tensorflow::grappler::Costs costs;
   tensorflow::Status status = _GetOpPerformanceDataAndRunTime(