| 80 | // test::FillIota<float>(&x, 1.0); |
| 81 | template <typename T> |
| 82 | void FillIota(Tensor* tensor, const T& val) { |
| 83 | auto flat = tensor->flat<T>(); |
| 84 | std::iota(flat.data(), flat.data() + flat.size(), val); |
| 85 | } |
| 86 | |
| 87 | // Fills in '*tensor' with a sequence of value of fn(0), fn(1), ... |
| 88 | // Tensor x(&alloc, DT_FLOAT, TensorShape({2, 2})); |