| 155 | } |
| 156 | |
| 157 | string DebugString(const Tensor& x, const Tensor& y, int tensor_size) { |
| 158 | CHECK_EQ(x.NumElements(), tensor_size); |
| 159 | CHECK_EQ(y.NumElements(), tensor_size); |
| 160 | auto x_flat = x.flat<float>(); |
| 161 | auto y_flat = y.flat<float>(); |
| 162 | // Just print the first couple of elements of each tensor |
| 163 | CHECK_GE(tensor_size, 2); |
| 164 | return strings::Printf("x = [%8.6f %8.6f] y = [%8.6f %8.6f]", x_flat(0), |
| 165 | x_flat(1), y_flat(0), y_flat(1)); |
| 166 | } |
| 167 | |
| 168 | // TODO: Support sharding and depth. |
| 169 | static void BM_Helper(int iters, int width, int num_stages, int tensor_size, |
no test coverage detected