| 270 | } |
| 271 | |
| 272 | nd::array eval() const |
| 273 | { |
| 274 | if (!needs_resize_) { |
| 275 | return a_; |
| 276 | } |
| 277 | auto resizer = data_resizer<I>(shape_, a_.shape(), slices_); |
| 278 | icm::vector<value_type> data; |
| 279 | auto v = std::accumulate(shape_.begin(), shape_.end(), 1, std::multiplies<int64_t>()); |
| 280 | data.resize(v); |
| 281 | auto a = nd::eval(a_); |
| 282 | auto d = a.data(); |
| 283 | resizer.template resize<value_type>(d.data(), reinterpret_cast<uint8_t*>(data.data())); |
| 284 | return nd::adapt(std::move(data), icm::shape(shape_)); |
| 285 | } |
| 286 | |
| 287 | constexpr bool is_dynamic() const noexcept |
| 288 | { |