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
1216a3b1
Unverified
Commit
1216a3b1
authored
Nov 02, 2022
by
Omiita
Committed by
GitHub
Nov 02, 2022
Browse files
Fix a small typo of a variable name (#1063)
Fix a small typo fix a typo in `models/attention.py`. weight -> width
parent
4e59bcc6
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
src/diffusers/models/attention.py
src/diffusers/models/attention.py
+3
-3
No files found.
src/diffusers/models/attention.py
View file @
1216a3b1
...
...
@@ -165,15 +165,15 @@ class SpatialTransformer(nn.Module):
def
forward
(
self
,
hidden_states
,
context
=
None
):
# note: if no context is given, cross-attention defaults to self-attention
batch
,
channel
,
height
,
w
eight
=
hidden_states
.
shape
batch
,
channel
,
height
,
w
idth
=
hidden_states
.
shape
residual
=
hidden_states
hidden_states
=
self
.
norm
(
hidden_states
)
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
*
w
eight
,
inner_dim
)
hidden_states
=
hidden_states
.
permute
(
0
,
2
,
3
,
1
).
reshape
(
batch
,
height
*
w
idth
,
inner_dim
)
for
block
in
self
.
transformer_blocks
:
hidden_states
=
block
(
hidden_states
,
context
=
context
)
hidden_states
=
hidden_states
.
reshape
(
batch
,
height
,
w
eight
,
inner_dim
).
permute
(
0
,
3
,
1
,
2
)
hidden_states
=
hidden_states
.
reshape
(
batch
,
height
,
w
idth
,
inner_dim
).
permute
(
0
,
3
,
1
,
2
)
hidden_states
=
self
.
proj_out
(
hidden_states
)
return
hidden_states
+
residual
...
...
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