data func scalar.
| 88 | |
| 89 | // data func scalar. |
| 90 | Graph* BinaryScalar(int num, const string& func) { |
| 91 | Graph* g = new Graph(OpRegistry::Global()); |
| 92 | Tensor lhs(DT_FLOAT, TensorShape({64, 64, num / (64 * 64)})); |
| 93 | lhs.flat<float>().setRandom(); |
| 94 | Tensor rhs(DT_FLOAT, TensorShape({})); |
| 95 | rhs.flat<float>().setRandom(); |
| 96 | test::graph::Binary(g, func, test::graph::Constant(g, lhs), |
| 97 | test::graph::Constant(g, rhs)); |
| 98 | return g; |
| 99 | } |
| 100 | |
| 101 | #define BM_BINARY_SCALAR(DEVICE, FUNC) \ |
| 102 | void BM_##DEVICE##_##FUNC##_scalar(int iters, int num) { \ |
nothing calls this directly
no test coverage detected