Browse Source

fix(mge): fix fastpath check

GitOrigin-RevId: acc8957469
release-1.9
Megvii Engine Team dengzheye 3 years ago
parent
commit
cca38c4e8d
1 changed files with 4 additions and 4 deletions
  1. +4
    -4
      imperative/python/src/tensor_utils.cpp

+ 4
- 4
imperative/python/src/tensor_utils.cpp View File

@@ -957,14 +957,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;


Loading…
Cancel
Save