aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/python/grappler
diff options
context:
space:
mode:
authorGravatar Benoit Steiner <bsteiner@google.com>2018-04-06 13:49:42 -0700
committerGravatar TensorFlower Gardener <gardener@tensorflow.org>2018-04-06 13:51:39 -0700
commited6a2cd368cea48433236563953f7c603ba78115 (patch)
tree5ec3623637051b407ff79a0ab205ca23f50a60fe /tensorflow/python/grappler
parente8dedc2c0f00dd28a3398cceb5e3293faaabbb9f (diff)
A single measurement is enough when using simulation
PiperOrigin-RevId: 191934781
Diffstat (limited to 'tensorflow/python/grappler')
-rw-r--r--tensorflow/python/grappler/cluster.i3
1 files changed, 2 insertions, 1 deletions
diff --git a/tensorflow/python/grappler/cluster.i b/tensorflow/python/grappler/cluster.i
index 067c8213d4..6816e20407 100644
--- a/tensorflow/python/grappler/cluster.i
+++ b/tensorflow/python/grappler/cluster.i
@@ -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(