We do not actually currently support recursive class definitions. I didn’t remember that in the previous thread (will comment there as well). https://github.com/pytorch/pytorch/pull/21842 8 improves the error message in this case.
We will likely support it soon (before the next release) but for now it will not work.