MCPcopy Create free account
hub / github.com/MegEngine/MegEngine / _pixel_shuffle_cpp

Function _pixel_shuffle_cpp

imperative/python/src/tensor_utils.cpp:1725–1736  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1723}
1724
1725py::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
1738PyObject* make_shape_tuple(PyObject* self, PyObject* const* args, size_t nargs) {
1739 try {

Callers 1

tensor_utils.cppFile · 0.85

Calls 6

enable_fastpathFunction · 0.85
castFunction · 0.85
py_applyFunction · 0.85
makeFunction · 0.50
funcFunction · 0.50
ptrMethod · 0.45

Tested by

no test coverage detected