| 210 | |
| 211 | template <class T> |
| 212 | Graph* BiasAdd(int rows, int cols, DataType type) { |
| 213 | Graph* g = new Graph(OpRegistry::Global()); |
| 214 | Tensor lhs(type, TensorShape({rows, cols})); |
| 215 | lhs.template flat<T>().setRandom(); |
| 216 | TensorShape rhs_shape; |
| 217 | rhs_shape = TensorShape({cols}); |
| 218 | Tensor rhs(type, rhs_shape); |
| 219 | rhs.template flat<T>().setRandom(); |
| 220 | test::graph::Binary(g, "BiasAdd", test::graph::Constant(g, lhs), |
| 221 | test::graph::Constant(g, rhs)); |
| 222 | return g; |
| 223 | } |
| 224 | |
| 225 | #define BM_BIAS_ADD(DEVICE, C_TYPE, TF_TYPE, R, C) \ |
| 226 | void BM_##DEVICE##_##C_TYPE##_BiasAdd_R##R##_C##C(int iters, int arg) { \ |
no test coverage detected