Turns out it’s because of a change in that’s listed in the docs here: https://pytorch.org/docs/stable/notes/extending.html 30, but not in the release notes.

One should be careful within __torch_function__ for subclasses to always call super().__torch_function__(func, ...) instead of func directly, as was the case before version 1.7.0. Failing to do this may cause func to recurse back into __torch_function__ and therefore cause infinite recursion.