| 290 | |
| 291 | template <class DType> |
| 292 | void arange_fill(DType* tensor, std::vector<int> shape, int bound = 1024) { |
| 293 | int length = |
| 294 | std::accumulate(shape.begin(), shape.end(), 1, std::multiplies<int>()); |
| 295 | for (int i = 0; i < length; ++i) { |
| 296 | tensor[i] = (DType)((i % bound)); |
| 297 | } |
| 298 | } |
| 299 | |
| 300 | template <class DType> |
| 301 | void constant_fill(DType* tensor, std::vector<int> shape, DType value) { |
nothing calls this directly
no outgoing calls
no test coverage detected