| 904 | } |
| 905 | |
| 906 | tuple<size_t, size_t> Shape() const override |
| 907 | { |
| 908 | pybind11::gil_scoped_acquire gil; |
| 909 | pybind11::function overload = pybind11::get_overload(this, "Shape"); |
| 910 | if(overload) |
| 911 | return py::cast<tuple<size_t, size_t>>(overload()); |
| 912 | else |
| 913 | { |
| 914 | auto height = pybind11::get_overload(this, "Height"); |
| 915 | auto width = pybind11::get_overload(this, "Width"); |
| 916 | if(!height || !width) |
| 917 | throw Exception("Shape must be overloaded in BaseMatrix!"); |
| 918 | return { py::cast<size_t>(height()), py::cast<size_t>(width()) }; |
| 919 | } |
| 920 | } |
| 921 | |
| 922 | int VHeight() const override { |
| 923 | return get<0>(Shape()); |