I don’t know if there are any clang vs. gcc compatibility issues here. One thing to know is that the PyTorch Python packages are built with a ancient-compatibility string ABI.
(If torch.compiled_with_cxx11_abi 1 returns False.) I would not know how to select that mode in clang.
Best regards
Thomas