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