| 124 | } |
| 125 | |
| 126 | void fill_tensor(CLTensor &tensor) |
| 127 | { |
| 128 | tensor.map(); |
| 129 | Window window; |
| 130 | window.use_tensor_dimensions(tensor.info()->tensor_shape()); |
| 131 | Iterator it_tensor(&tensor, window); |
| 132 | unsigned char val(0); |
| 133 | execute_window_loop( |
| 134 | window, [&](const Coordinates &) { *reinterpret_cast<unsigned char *>(it_tensor.ptr()) = val++; }, |
| 135 | it_tensor); |
| 136 | tensor.unmap(); |
| 137 | } |
| 138 | void init_tensor(const TensorShape shape, CLTensor &tensor, DataType type, DataLayout layout) |
| 139 | { |
| 140 | tensor.allocator()->init(TensorInfo(shape, 1, type).set_data_layout(layout)); |