| 1723 | } |
| 1724 | |
| 1725 | py::object _pixel_shuffle_cpp(py::handle inp, py::handle val, py::handle func) { |
| 1726 | if (enable_fastpath(inp) && PyLong_Check(val.ptr())) { |
| 1727 | std::shared_ptr<OpDef> op = PixelShuffle::make(val.cast<int32_t>()); |
| 1728 | py::object Op = py::cast(op); |
| 1729 | PyObject* p[2] = {Op.ptr(), inp.ptr()}; |
| 1730 | py::tuple ret = py::reinterpret_steal<py::object>(py_apply(NULL, p, 2)); |
| 1731 | return ret[0]; |
| 1732 | } else { |
| 1733 | // fallback to traceable subgraph implement |
| 1734 | return func(inp, val); |
| 1735 | } |
| 1736 | } |
| 1737 | |
| 1738 | PyObject* make_shape_tuple(PyObject* self, PyObject* const* args, size_t nargs) { |
| 1739 | try { |
no test coverage detected