Skip to content

Commit 040e54a

Browse files
committed
add xpu part
1 parent e8fc8b1 commit 040e54a

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

tests/pipelines/controlnet_hunyuandit/test_controlnet_hunyuandit.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -153,9 +153,14 @@ def test_controlnet_hunyuandit(self):
153153
image_slice = image[0, -3:, -3:, -1]
154154
assert image.shape == (1, 16, 16, 3)
155155

156-
expected_slice = np.array(
157-
[0.6953125, 0.89208984, 0.59375, 0.5078125, 0.5786133, 0.6035156, 0.5839844, 0.53564453, 0.52246094]
158-
)
156+
if torch_device == "xpu":
157+
expected_slice = np.array(
158+
[0.6376953, 0.84375, 0.58691406, 0.48046875, 0.43652344, 0.5517578, 0.54248047, 0.5644531, 0.48217773]
159+
)
160+
else:
161+
expected_slice = np.array(
162+
[0.6953125, 0.89208984, 0.59375, 0.5078125, 0.5786133, 0.6035156, 0.5839844, 0.53564453, 0.52246094]
163+
)
159164

160165
assert (
161166
np.abs(image_slice.flatten() - expected_slice).max() < 1e-2

0 commit comments

Comments
 (0)