Don't do anything in benchmarks if iters == 0.

Change: 122740998
This commit is contained in:
A. Unique TensorFlower 2016-05-19 08:48:09 -08:00 committed by TensorFlower Gardener
parent e55e45aef7
commit 7584aa60a4

View File

@ -115,7 +115,9 @@ string GetRendezvousKey(const Node* node) {
void Benchmark::RunWithArgs(
const std::vector<std::pair<const Node*, Tensor>>& inputs,
const std::vector<const Node*>& outputs, int iters) {
if (device_) {
if (!device_ || iters == 0) {
return;
}
// Gets inputs' and outputs' rendezvous keys.
std::vector<std::pair<string, Tensor>> in;
for (const auto& p : inputs) {
@ -158,7 +160,6 @@ void Benchmark::RunWithArgs(
TF_CHECK_OK(device_->Sync());
testing::StopTiming();
}
}
} // end namespace test