Skip to content

Commit 0c1ccc0

Browse files
sywangyisayakpaul
andauthored
fix pytest tests/pipelines/pixart_sigma/test_pixart.py::PixArtSigmaPi… (#12842)
fix pytest tests/pipelines/pixart_sigma/test_pixart.py::PixArtSigmaPipelineIntegrationTests::test_pixart_512 in xpu Signed-off-by: Wang, Yi <yi.a.wang@intel.com> Co-authored-by: Sayak Paul <spsayakpaul@gmail.com>
1 parent b8a4cba commit 0c1ccc0

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

tests/pipelines/pixart_sigma/test_pixart.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
)
3030

3131
from ...testing_utils import (
32+
Expectations,
3233
backend_empty_cache,
3334
enable_full_determinism,
3435
numpy_cosine_similarity_distance,
@@ -335,7 +336,14 @@ def test_pixart_512(self):
335336
image = pipe(prompt, generator=generator, num_inference_steps=2, output_type="np").images
336337

337338
image_slice = image[0, -3:, -3:, -1]
338-
expected_slice = np.array([0.0479, 0.0378, 0.0217, 0.0942, 0.064, 0.0791, 0.2073, 0.1975, 0.2017])
339+
340+
expected_slices = Expectations(
341+
{
342+
("xpu", 3): np.array([0.0417, 0.0388, 0.0061, 0.0618, 0.0517, 0.0420, 0.1038, 0.1055, 0.1257]),
343+
("cuda", None): np.array([0.0479, 0.0378, 0.0217, 0.0942, 0.064, 0.0791, 0.2073, 0.1975, 0.2017]),
344+
}
345+
)
346+
expected_slice = expected_slices.get_expectation()
339347

340348
max_diff = numpy_cosine_similarity_distance(image_slice.flatten(), expected_slice)
341349
self.assertLessEqual(max_diff, 1e-4)

0 commit comments

Comments
 (0)