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

Function ThreeDXZReduce

tensorflow/core/kernels/reduction_ops_test.cc:72–82  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

70}
71
72static Graph* ThreeDXZReduce(const string& reduce, int num_y, int num_z) {
73 auto* g = new Graph(OpRegistry::Global());
74 Tensor data(DT_FLOAT, TensorShape({4, num_y, num_z}));
75 data.flat<float>().setRandom();
76 Tensor axes(DT_INT32, TensorShape({2}));
77 axes.flat<int32>()(0) = 0;
78 axes.flat<int32>()(1) = 2;
79 test::graph::Reduce(g, reduce, test::graph::Constant(g, data),
80 test::graph::Constant(g, axes));
81 return g;
82}
83
84// Creates a bench which reduces a 3D tensor with total "num" floats
85// into a scalar on a "device". Runs the bench for "iters" times.

Callers 1

Do3DXZReduceFunction · 0.85

Calls 3

ConstantFunction · 0.70
TensorShapeClass · 0.50
ReduceFunction · 0.50

Tested by

no test coverage detected