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

Function MulChain

tensorflow/core/kernels/basic_ops_benchmark_test.cc:48–63  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

46}
47
48static void MulChain(int chain_length, Graph** init_g, Graph** run_g) {
49 {
50 Graph* g = new Graph(OpRegistry::Global());
51 auto var = Var(g, 1);
52 test::graph::Assign(g, var, Zeros(g, 1));
53 *init_g = g;
54 }
55 {
56 Graph* g = new Graph(OpRegistry::Global());
57 Node* cur = Var(g, 1);
58 for (int i = 0; i < chain_length - 1; ++i) {
59 cur = test::graph::Multi(g, i % 2 == 0 ? "Div" : "Mul", {cur, cur});
60 }
61 *run_g = g;
62 }
63}
64
65// Benchmark a chain of simple multiplications.
66// This emphasizes per-op overhead.

Callers 1

BM_MulChainFunction · 0.85

Calls 4

MultiFunction · 0.85
VarFunction · 0.70
AssignClass · 0.70
ZerosFunction · 0.70

Tested by

no test coverage detected