@@ -93,10 +93,10 @@ std::ostream& operator<<(std::ostream& os, const EnumStruct& v) {
93
93
}
94
94
95
95
template <typename T>
96
- py::array mkarray_via_buffer (size_t n) {
97
- return py::array (py::buffer_info (nullptr , sizeof (T),
98
- py::format_descriptor<T>::format (),
99
- 1 , { n }, { sizeof (T) }));
96
+ py::array<> mkarray_via_buffer (size_t n) {
97
+ return py::array<> (py::buffer_info (nullptr , sizeof (T),
98
+ py::format_descriptor<T>::format (),
99
+ 1 , { n }, { sizeof (T) }));
100
100
}
101
101
102
102
template <typename S>
@@ -228,7 +228,7 @@ py::array_t<int32_t, 0> test_array_ctors(int i) {
228
228
py::buffer_info buf_ndim2 (vptr, 4 , " i" , 2 , shape, strides);
229
229
py::buffer_info buf_ndim2_null (nullptr , 4 , " i" , 2 , shape, strides);
230
230
231
- auto fill = [](py::array arr) {
231
+ auto fill = [](py::array<> arr) {
232
232
auto req = arr.request ();
233
233
for (int i = 0 ; i < 6 ; i++) ((int32_t *) req.ptr )[i] = i + 1 ;
234
234
return arr;
@@ -237,34 +237,34 @@ py::array_t<int32_t, 0> test_array_ctors(int i) {
237
237
switch (i) {
238
238
// shape: (3, 2)
239
239
case 10 : return arr_t (shape, strides, ptr);
240
- case 11 : return py::array (shape, strides, ptr);
241
- case 12 : return py::array (dtype, shape, strides, vptr);
240
+ case 11 : return py::array<> (shape, strides, ptr);
241
+ case 12 : return py::array<> (dtype, shape, strides, vptr);
242
242
case 13 : return arr_t (shape, ptr);
243
- case 14 : return py::array (shape, ptr);
244
- case 15 : return py::array (dtype, shape, vptr);
243
+ case 14 : return py::array<> (shape, ptr);
244
+ case 15 : return py::array<> (dtype, shape, vptr);
245
245
case 16 : return arr_t (buf_ndim2);
246
- case 17 : return py::array (buf_ndim2);
246
+ case 17 : return py::array<> (buf_ndim2);
247
247
// shape: (3, 2) - post-fill
248
248
case 20 : return fill (arr_t (shape, strides));
249
- case 21 : return py::array (shape, strides, ptr); // can't have nullptr due to templated ctor
250
- case 22 : return fill (py::array (dtype, shape, strides));
249
+ case 21 : return py::array<> (shape, strides, ptr); // can't have nullptr due to templated ctor
250
+ case 22 : return fill (py::array<> (dtype, shape, strides));
251
251
case 23 : return fill (arr_t (shape));
252
- case 24 : return py::array (shape, ptr); // can't have nullptr due to templated ctor
253
- case 25 : return fill (py::array (dtype, shape));
252
+ case 24 : return py::array<> (shape, ptr); // can't have nullptr due to templated ctor
253
+ case 25 : return fill (py::array<> (dtype, shape));
254
254
case 26 : return fill (arr_t (buf_ndim2_null));
255
- case 27 : return fill (py::array (buf_ndim2_null));
255
+ case 27 : return fill (py::array<> (buf_ndim2_null));
256
256
// shape: (6, )
257
257
case 30 : return arr_t (6 , ptr);
258
- case 31 : return py::array (6 , ptr);
259
- case 32 : return py::array (dtype, 6 , vptr);
258
+ case 31 : return py::array<> (6 , ptr);
259
+ case 32 : return py::array<> (dtype, 6 , vptr);
260
260
case 33 : return arr_t (buf_ndim1);
261
- case 34 : return py::array (buf_ndim1);
261
+ case 34 : return py::array<> (buf_ndim1);
262
262
// shape: (6, )
263
263
case 40 : return fill (arr_t (6 ));
264
- case 41 : return py::array (6 , ptr); // can't have nullptr due to templated ctor
265
- case 42 : return fill (py::array (dtype, 6 ));
264
+ case 41 : return py::array<> (6 , ptr); // can't have nullptr due to templated ctor
265
+ case 42 : return fill (py::array<> (dtype, 6 ));
266
266
case 43 : return fill (arr_t (buf_ndim1_null));
267
- case 44 : return fill (py::array (buf_ndim1_null));
267
+ case 44 : return fill (py::array<> (buf_ndim1_null));
268
268
}
269
269
return arr_t ();
270
270
}
0 commit comments