diff --git a/imperative/python/src/tensor.cpp b/imperative/python/src/tensor.cpp index 44c4099e3a637540ef33ce69d666e026c6ceba1e..0064192c61419d4f47c3b4d317f45f4d61a49c71 100644 --- a/imperative/python/src/tensor.cpp +++ b/imperative/python/src/tensor.cpp @@ -495,9 +495,10 @@ PyObject* TensorWrapper::detach() { new_tensor = std::make_shared(m_tensor->m_var); } new_tensor->m_trace_info = m_tensor->m_trace_info; + + new_tensor->m_flags = m_tensor->m_flags; auto ret = TensorWrapper::make(pytype, std::move(new_tensor)); return ret.release().ptr(); - } PyObject* TensorWrapper::_dev_tensor(){