You could iterate the parameters of both models and compare them:
for a, b in zip(modelA.parameters(), modelB.parameters()):
    if not (a == b).all():
        print('False')
        break

Of course you can add more checks (e.g. for the shape etc.).
Also, the loop assumes the parameters are initialized in the same order, but I assume that’s also a requirement for your “equal” method.