| 70 | } |
| 71 | |
| 72 | static 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. |
no test coverage detected