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

Function enable_fastpath

imperative/python/src/tensor_utils.cpp:927–940  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

925}
926
927bool enable_fastpath(py::handle inp) {
928 auto&& tm_tr = TransformationManager::get_instance()
929 .segments[TransformationManager::Segment::ModuleTrace];
930 bool is_varnode = PyObject_TypeCheck(inp.ptr(), py_varnode_type);
931 if (is_varnode ||
932 TransformationManager::get_instance()
933 .segments[TransformationManager::Segment::Trace]
934 .size() > 0 ||
935 (tm_tr.size() > 0 &&
936 reinterpret_cast<ModuleTraceTransformation*>(tm_tr[0].get())->enabled())) {
937 return false;
938 }
939 return true;
940}
941
942bool subtensor_fastpath(py::handle inp_hdl, py::tuple tuple_val) {
943 bool use_fastpath = true;

Callers 8

subtensor_fastpathFunction · 0.85
_broadcast_cppFunction · 0.85
_reshape_cppFunction · 0.85
_adaptive_pool2d_cppFunction · 0.85
_setitem_cppFunction · 0.85
_split_cppFunction · 0.85
_pixel_shuffle_cppFunction · 0.85
tensor_utils.cppFile · 0.85

Calls 4

ptrMethod · 0.45
sizeMethod · 0.45
enabledMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected