MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / BM_Iterate

Function BM_Iterate

tensorflow/compiler/xla/shape_tree_test.cc:591–606  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

589}
590
591void BM_Iterate(int iters, int depth, int fan_out) {
592 tensorflow::testing::StopTiming();
593 Shape shape = ShapeUtil::MakeShape(F32, {32, 64, 128});
594 for (int i = 0; i < depth; ++i) {
595 std::vector<xla::Shape> shapes(fan_out, shape);
596 shape = ShapeUtil::MakeTupleShape(shapes);
597 }
598 tensorflow::testing::StartTiming();
599
600 ShapeTree<int> shape_tree(shape);
601 for (int i = 0; i < iters; ++i) {
602 for (auto& iter : shape_tree) {
603 tensorflow::testing::DoNotOptimize(iter.second);
604 }
605 }
606}
607
608#define BENCHMARK_WITH_ARGS(name) \
609 BENCHMARK(name)->ArgPair(2, 8)->ArgPair(1, 1000)

Callers

nothing calls this directly

Calls 4

StopTimingFunction · 0.85
MakeShapeFunction · 0.85
StartTimingFunction · 0.85
DoNotOptimizeFunction · 0.85

Tested by

no test coverage detected