Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
renzhc
diffusers_dcu
Commits
013955b5
Unverified
Commit
013955b5
authored
Jan 19, 2023
by
Patrick von Platen
Committed by
GitHub
Jan 19, 2023
Browse files
[Dit] Fix dit tests (#2034)
* [Dit] Fix dit tests * up
parent
ed616bd8
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
7 deletions
+5
-7
tests/pipelines/dit/test_dit.py
tests/pipelines/dit/test_dit.py
+5
-7
No files found.
tests/pipelines/dit/test_dit.py
View file @
013955b5
...
...
@@ -36,10 +36,10 @@ class DiTPipelineFastTests(PipelineTesterMixin, unittest.TestCase):
def
get_dummy_components
(
self
):
torch
.
manual_seed
(
0
)
transformer
=
Transformer2DModel
(
sample_size
=
4
,
sample_size
=
16
,
num_layers
=
2
,
patch_size
=
2
,
attention_head_dim
=
2
,
patch_size
=
4
,
attention_head_dim
=
8
,
num_attention_heads
=
2
,
in_channels
=
4
,
out_channels
=
8
,
...
...
@@ -79,10 +79,8 @@ class DiTPipelineFastTests(PipelineTesterMixin, unittest.TestCase):
image
=
pipe
(
**
inputs
).
images
image_slice
=
image
[
0
,
-
3
:,
-
3
:,
-
1
]
self
.
assertEqual
(
image
.
shape
,
(
1
,
4
,
4
,
3
))
expected_slice
=
np
.
array
(
[
0.44405967
,
0.33592293
,
0.6093237
,
0.48981372
,
0.79098296
,
0.7504172
,
0.59413105
,
0.49462673
,
0.35190058
]
)
self
.
assertEqual
(
image
.
shape
,
(
1
,
16
,
16
,
3
))
expected_slice
=
np
.
array
([
0.4380
,
0.4141
,
0.5159
,
0.0000
,
0.4282
,
0.6680
,
0.5485
,
0.2545
,
0.6719
])
max_diff
=
np
.
abs
(
image_slice
.
flatten
()
-
expected_slice
).
max
()
self
.
assertLessEqual
(
max_diff
,
1e-3
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment