What I do is that I check that same input produces same output, then same grads then same optimizer step (with “same” up to numerical accuracy). Many operations have subtle difference between different frameworks, e.g. whether a “mean” is taken or a “sum” or similar.
Best regards
Thomas