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
15241225
Unverified
Commit
15241225
authored
Nov 24, 2022
by
Suraj Patil
Committed by
GitHub
Nov 24, 2022
Browse files
[Transformer2DModel] don't norm twice (#1381)
don't norm twice
parent
f07a16e0
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
2 deletions
+0
-2
src/diffusers/models/attention.py
src/diffusers/models/attention.py
+0
-2
No files found.
src/diffusers/models/attention.py
View file @
15241225
...
...
@@ -201,13 +201,11 @@ class Transformer2DModel(ModelMixin, ConfigMixin):
residual
=
hidden_states
hidden_states
=
self
.
norm
(
hidden_states
)
if
not
self
.
use_linear_projection
:
hidden_states
=
self
.
proj_in
(
hidden_states
)
inner_dim
=
hidden_states
.
shape
[
1
]
hidden_states
=
hidden_states
.
permute
(
0
,
2
,
3
,
1
).
reshape
(
batch
,
height
*
weight
,
inner_dim
)
else
:
hidden_states
=
self
.
norm
(
hidden_states
)
inner_dim
=
hidden_states
.
shape
[
1
]
hidden_states
=
hidden_states
.
permute
(
0
,
2
,
3
,
1
).
reshape
(
batch
,
height
*
weight
,
inner_dim
)
hidden_states
=
self
.
proj_in
(
hidden_states
)
...
...
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