@@ -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,18 @@ 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+ sh_type sh = xtl::make_sequence<sh_type>(shape.size ());
342+ std::copy (shape.begin (), shape.end (), sh.begin ());
343+ sh_type ch_sh = xtl::make_sequence<sh_type>(chunk_shape.size ());
344+ std::copy (chunk_shape.begin (), chunk_shape.end (), ch_sh.begin ());
345+ using chunk_storage = xarray<xarray<T, L>>;
346+ return xchunked_array<chunk_storage, EXT>(chunk_storage (), std::move (sh), std::move (ch_sh), chunk_memory_layout);
347+ }
348+
334349 template <layout_type L, class EXT , class E , class S >
335350 inline xchunked_array<xarray<xarray<typename E::value_type>>, EXT>
336351 chunked_array (const xexpression<E>& e, S&& chunk_shape, layout_type chunk_memory_layout)
0 commit comments