@tqchen it is possible to merge the two in one and use nullptr, however the design of mutual recursion will require each recclosure to keep both a vector of closure, and index (so it cannot be merged). Hence, I think they should be seprated.
It is indeed ugly, but the principled approach to dealing with this is to employ a cycle detector alongside the shared_ptr. -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/dmlc/tvm/issues/4143#issuecomment-544079665