| 44 | } |
| 45 | |
| 46 | array get(int64_t) const |
| 47 | { |
| 48 | if (shape_.size() == 1) { |
| 49 | if constexpr (base::arithmetic<value_type>) { |
| 50 | return array(value_type()); |
| 51 | } else if constexpr (std::is_same_v<value_type, nd::dict>) { |
| 52 | return adapt(nd::dict()); |
| 53 | } else if constexpr (std::is_same_v<value_type, std::string_view>) { |
| 54 | return adapt(std::string()); |
| 55 | } else { |
| 56 | ASSERT(false); |
| 57 | } |
| 58 | } |
| 59 | return array(empty_array<value_type>(icm::shape(shape_.begin() + 1, shape_.end()))); |
| 60 | } |
| 61 | |
| 62 | constexpr bool is_dynamic() const noexcept |
| 63 | { |