diffusers
diffusers copied to clipboard
[tests] enhance attention backend tests
What does this PR do?
Even though we will have separate unit-level testing for attention backends in https://github.com/huggingface/diffusers/pull/12822/, I think it's still nice to have integration tests.
This PR:
- Change from
torch.allclose()tonumpy_cosine_similarity(). - Change
numpy_cosine_similarityto accept torch tensors.
This also helps us relax the environmental constraints.