| 46 | { |
| 47 | template <typename T> |
| 48 | inline void fill_tensor(Tensor &tensor, const std::vector<T> &v) |
| 49 | { |
| 50 | // Import memory accounting for padding |
| 51 | TensorShape t_shape = tensor.info()->tensor_shape(); |
| 52 | Window window; |
| 53 | window.use_tensor_dimensions(t_shape); |
| 54 | Iterator out(&tensor, window); |
| 55 | execute_window_loop( |
| 56 | window, [&](const Coordinates &id) { *reinterpret_cast<T *>(out.ptr()) = v[coord2index(t_shape, id)]; }, out); |
| 57 | } |
| 58 | |
| 59 | template <typename T> |
| 60 | inline void fill_tensor(SimpleTensor<T> &tensor, const std::vector<T> &v) |