File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -328,8 +328,9 @@ class array : public buffer {
328
328
329
329
array () : array(0 , static_cast <const double *>(nullptr )) {}
330
330
331
- array (const pybind11::dtype &dt, const std::vector<size_t > &shape,
332
- const std::vector<size_t > &strides, const void *ptr = nullptr ,
331
+ template <typename Shape, typename Strides>
332
+ array (const pybind11::dtype &dt, const Shape &shape,
333
+ const Strides &strides, const void *ptr = nullptr ,
333
334
handle base = handle()) {
334
335
auto & api = detail::npy_api::get ();
335
336
auto ndim = shape.size ();
@@ -525,7 +526,7 @@ class array : public buffer {
525
526
throw std::runtime_error (" array is not writeable" );
526
527
}
527
528
528
- static std::vector<size_t > default_strides (const std::vector< size_t > & shape, size_t itemsize) {
529
+ template < typename Shape> static std::vector<size_t > default_strides (const Shape & shape, size_t itemsize) {
529
530
auto ndim = shape.size ();
530
531
std::vector<size_t > strides (ndim);
531
532
if (ndim) {
You can’t perform that action at this time.
0 commit comments