| 299 | |
| 300 | template <class DType> |
| 301 | void constant_fill(DType* tensor, std::vector<int> shape, DType value) { |
| 302 | int length = |
| 303 | std::accumulate(shape.begin(), shape.end(), 1, std::multiplies<int>()); |
| 304 | for (int i = 0; i < length; ++i) { |
| 305 | tensor[i] = value; |
| 306 | } |
| 307 | } |
| 308 | |
| 309 | template <class DType> |
| 310 | DType* alloc_gpu_tensor(std::vector<int> shape) { |
nothing calls this directly
no outgoing calls
no test coverage detected