diff --git a/pyop/pyfunc.cc b/pyop/pyfunc.cc index 5db122f4..28744b81 100644 --- a/pyop/pyfunc.cc +++ b/pyop/pyfunc.cc @@ -399,9 +399,9 @@ void PyCustomOpDef::AddOp(const PyCustomOpDef* cod) { // No need to protect against concurrent access, GIL is doing that. auto val = std::make_pair(op_domain, std::vector()); - const auto [it_domain_op, success] = PyOp_container().insert(val); + auto [it_domain_op, success] = PyOp_container().insert(val); assert(success || !it_domain_op->second.empty()); - it_domain_op->second.emplace_back(PyCustomOpFactory(cod, op_domain, op)); + it_domain_op->second.emplace_back(cod, op_domain, op); } const PyCustomOpFactory* PyCustomOpDef_FetchPyCustomOps(size_t num) {