| 29 | namespace { |
| 30 | |
| 31 | void CreateConstOp(const string& name, std::initializer_list<int64> dims, |
| 32 | NodeDef* node) { |
| 33 | Tensor tensor(DT_FLOAT, TensorShape(dims)); |
| 34 | for (int64 i = 0; i < tensor.NumElements(); ++i) |
| 35 | tensor.flat<float>()(i) = i / 10.0f; |
| 36 | TF_CHECK_OK(NodeDefBuilder(name, "Const") |
| 37 | .Attr("dtype", DT_FLOAT) |
| 38 | .Attr("value", tensor) |
| 39 | .Finalize(node)); |
| 40 | } |
| 41 | |
| 42 | void CreateConstSizesOp(const string& name, const std::vector<int32>& sizes, |
| 43 | NodeDef* node) { |
no test coverage detected