Don't do anything in benchmarks if iters == 0.
Change: 122740998
This commit is contained in:
parent
e55e45aef7
commit
7584aa60a4
@ -115,7 +115,9 @@ string GetRendezvousKey(const Node* node) {
|
|||||||
void Benchmark::RunWithArgs(
|
void Benchmark::RunWithArgs(
|
||||||
const std::vector<std::pair<const Node*, Tensor>>& inputs,
|
const std::vector<std::pair<const Node*, Tensor>>& inputs,
|
||||||
const std::vector<const Node*>& outputs, int iters) {
|
const std::vector<const Node*>& outputs, int iters) {
|
||||||
if (device_) {
|
if (!device_ || iters == 0) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
// Gets inputs' and outputs' rendezvous keys.
|
// Gets inputs' and outputs' rendezvous keys.
|
||||||
std::vector<std::pair<string, Tensor>> in;
|
std::vector<std::pair<string, Tensor>> in;
|
||||||
for (const auto& p : inputs) {
|
for (const auto& p : inputs) {
|
||||||
@ -158,7 +160,6 @@ void Benchmark::RunWithArgs(
|
|||||||
|
|
||||||
TF_CHECK_OK(device_->Sync());
|
TF_CHECK_OK(device_->Sync());
|
||||||
testing::StopTiming();
|
testing::StopTiming();
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
} // end namespace test
|
} // end namespace test
|
||||||
|
Loading…
Reference in New Issue
Block a user