| 186 | } |
| 187 | |
| 188 | NumPyAccessor::NumPyAccessor( |
| 189 | std::string npy_path, TensorShape shape, DataType data_type, DataLayout data_layout, std::ostream &output_stream) |
| 190 | : _npy_tensor(), _filename(std::move(npy_path)), _output_stream(output_stream) |
| 191 | { |
| 192 | NumPyBinLoader loader(_filename, data_layout); |
| 193 | |
| 194 | TensorInfo info(shape, 1, data_type); |
| 195 | info.set_data_layout(data_layout); |
| 196 | |
| 197 | _npy_tensor.allocator()->init(info); |
| 198 | _npy_tensor.allocator()->allocate(); |
| 199 | |
| 200 | loader.access_tensor(_npy_tensor); |
| 201 | } |
| 202 | |
| 203 | template <typename T> |
| 204 | void NumPyAccessor::access_numpy_tensor(ITensor &tensor, T tolerance) |
nothing calls this directly
no test coverage detected