@@ -234,6 +234,9 @@ namespace xt
234234 template <class T , layout_type L = XTENSOR_DEFAULT_LAYOUT, class EXT = empty_extension, class S >
235235 xchunked_array<xarray<xarray<T>>, EXT> chunked_array (S&& shape, S&& chunk_shape, layout_type chunk_memory_layout = XTENSOR_DEFAULT_LAYOUT);
236236
237+ template <class T , layout_type L = XTENSOR_DEFAULT_LAYOUT, class EXT = empty_extension, class S >
238+ xchunked_array<xarray<xarray<T>>, EXT> chunked_array (std::initializer_list<S> shape, std::initializer_list<S> chunk_shape, layout_type chunk_memory_layout = XTENSOR_DEFAULT_LAYOUT);
239+
237240 /* *
238241 * Creates an in-memory chunked array.
239242 * This function returns a ``xchunked_array<xarray<T>>`` initialized from an expression.
@@ -331,6 +334,15 @@ namespace xt
331334 return xchunked_array<chunk_storage, EXT>(chunk_storage (), std::forward<S>(shape), std::forward<S>(chunk_shape), chunk_memory_layout);
332335 }
333336
337+ template <class T , layout_type L, class EXT , class S >
338+ xchunked_array<xarray<xarray<T>>, EXT> chunked_array (std::initializer_list<S> shape, std::initializer_list<S> chunk_shape, layout_type chunk_memory_layout)
339+ {
340+ using sh_type = std::vector<std::size_t >;
341+ auto sh = xtl::forward_sequence<sh_type, std::initializer_list<S>>(shape);
342+ auto ch_sh = xtl::forward_sequence<sh_type, std::initializer_list<S>>(chunk_shape);
343+ return chunked_array<T, L, EXT, sh_type>(std::move (sh), std::move (ch_sh), chunk_memory_layout);
344+ }
345+
334346 template <layout_type L, class EXT , class E , class S >
335347 inline xchunked_array<xarray<xarray<typename E::value_type>>, EXT>
336348 chunked_array (const xexpression<E>& e, S&& chunk_shape, layout_type chunk_memory_layout)
0 commit comments