提交 7005b7d6 编写于 作者: M Megvii Engine Team

fix(mge): fix fastpath check

GitOrigin-RevId: acc8957469fde049e1c4e58f3c808a0eb992d9da
上级 7bf5b0ee
......@@ -958,14 +958,14 @@ std::tuple<std::vector<int32_t>, bool> tuple2vector(py::object shape) {
}
bool enable_fastpath(py::handle inp) {
// FIXME: the way to judge whether it is in traced module is inaccurate
auto&& tm_tr = TransformationManager::get_instance()
.segments[TransformationManager::Segment::ModuleTrace];
if (!TensorWrapper::try_cast(inp.ptr()) ||
TransformationManager::get_instance()
.segments[TransformationManager::Segment::Trace]
.size() > 0 ||
TransformationManager::get_instance()
.segments[TransformationManager::Segment::ModuleTrace]
.size() > 0) {
(tm_tr.size() > 0 &&
reinterpret_cast<ModuleTraceTransformation*>(tm_tr[0].get())->enabled())) {
return false;
}
return true;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册