Lines Matching refs:def

112     sm.def(#name, [](type a) { return name(a); }); \
113 sm.def(#name, [](type a, int i) { return name(a, i); }); \
114 sm.def(#name, [](type a, int i, int j) { return name(a, i, j); }); \
115 sm.def(#name, [](type a, int i, int j, int k) { return name(a, i, j, k); });
143 .def("__repr__", [](const DtypeCheck& self) {
147 sm.def("get_concrete_dtype_checks", &get_concrete_dtype_checks);
153 .def("__repr__", [](const DtypeSizeCheck& self) {
157 sm.def("get_platform_dtype_size_checks", &get_platform_dtype_size_checks);
160 sm.def("ndim", [](const arr& a) { return a.ndim(); });
161 sm.def("shape", [](const arr& a) { return arr(a.ndim(), a.shape()); });
162 sm.def("shape", [](const arr& a, ssize_t dim) { return a.shape(dim); });
163 sm.def("strides", [](const arr& a) { return arr(a.ndim(), a.strides()); });
164 sm.def("strides", [](const arr& a, ssize_t dim) { return a.strides(dim); });
165 sm.def("writeable", [](const arr& a) { return a.writeable(); });
166 sm.def("size", [](const arr& a) { return a.size(); });
167 sm.def("itemsize", [](const arr& a) { return a.itemsize(); });
168 sm.def("nbytes", [](const arr& a) { return a.nbytes(); });
169 sm.def("owndata", [](const arr& a) { return a.owndata(); });
186 sm.def("make_f_array", [] { return py::array_t<float>({ 2, 2 }, { 4, 8 }); });
187 sm.def("make_c_array", [] { return py::array_t<float>({ 2, 2 }, { 8, 4 }); });
190 sm.def("make_empty_shaped_array", [] { return py::array(py::dtype("f"), {}, {}); });
192 sm.def("scalar_int", []() { return py::array(py::dtype("i"), {}, {}, &data_i); });
195 sm.def("wrap", [](py::array a) {
212 .def(py::init<>())
213 .def("numpy_view", [](py::object &obj) {
221 sm.def("function_taking_uint64", [](uint64_t) { });
224 sm.def("isinstance_untyped", [](py::object yes, py::object no) {
227 sm.def("isinstance_typed", [](py::object o) {
232 sm.def("default_constructors", []() {
239 sm.def("converting_constructors", [](py::object o) {
248 sm.def("overloaded", [](py::array_t<double>) { return "double"; });
249 sm.def("overloaded", [](py::array_t<float>) { return "float"; });
250 sm.def("overloaded", [](py::array_t<int>) { return "int"; });
251 sm.def("overloaded", [](py::array_t<unsigned short>) { return "unsigned short"; });
252 sm.def("overloaded", [](py::array_t<long long>) { return "long long"; });
253 sm.def("overloaded", [](py::array_t<std::complex<double>>) { return "double complex"; });
254 sm.def("overloaded", [](py::array_t<std::complex<float>>) { return "float complex"; });
256 sm.def("overloaded2", [](py::array_t<std::complex<double>>) { return "double complex"; });
257 sm.def("overloaded2", [](py::array_t<double>) { return "double"; });
258 sm.def("overloaded2", [](py::array_t<std::complex<float>>) { return "float complex"; });
259 sm.def("overloaded2", [](py::array_t<float>) { return "float"; });
262 sm.def("overloaded3", [](py::array_t<int>) { return "int"; }, py::arg().noconvert());
263 sm.def("overloaded3", [](py::array_t<double>) { return "double"; }, py::arg().noconvert());
267 sm.def("overloaded4", [](py::array_t<long long, 0>) { return "long long"; });
268 sm.def("overloaded4", [](py::array_t<double, 0>) { return "double"; });
272 sm.def("overloaded5", [](py::array_t<unsigned int>) { return "unsigned int"; });
273 sm.def("overloaded5", [](py::array_t<double>) { return "double"; });
277 sm.def("issue685", [](std::string) { return "string"; });
278 sm.def("issue685", [](py::array) { return "array"; });
279 sm.def("issue685", [](py::object) { return "other"; });
282 sm.def("proxy_add2", [](py::array_t<double> a, double v) {
289 sm.def("proxy_init3", [](double start) {
298 sm.def("proxy_init3F", [](double start) {
307 sm.def("proxy_squared_L2_norm", [](py::array_t<double> a) {
315 sm.def("proxy_auxiliaries2", [](py::array_t<double> a) {
323 sm.def("proxy_add2_dyn", [](py::array_t<double> a, double v) {
330 sm.def("proxy_init3_dyn", [](double start) {
340 sm.def("proxy_auxiliaries2_dyn", [](py::array_t<double> a) {
344 sm.def("array_auxiliaries2", [](py::array_t<double> a) {
350 sm.def("array_fail_test", []() { return py::array(py::object()); });
351 sm.def("array_t_fail_test", []() { return py::array_t<double>(py::object()); });
353 sm.def("array_fail_test_negative_size", []() { int c = 0; return py::array(-1, &c); });
357 sm.def("array_initializer_list1", []() { return py::array_t<float>(1); }); // { 1 } also works, but clang warns about it
358 sm.def("array_initializer_list2", []() { return py::array_t<float>({ 1, 2 }); });
359 sm.def("array_initializer_list3", []() { return py::array_t<float>({ 1, 2, 3 }); });
360 sm.def("array_initializer_list4", []() { return py::array_t<float>({ 1, 2, 3, 4 }); });
364 sm.def("array_reshape2", [](py::array_t<double> a) {
372 sm.def("array_resize3", [](py::array_t<double> a, size_t N, bool refcheck) {
378 sm.def("create_and_resize", [](size_t N) {
386 sm.def("index_using_ellipsis", [](py::array a) {