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
eef2327a
Commit
eef2327a
authored
Jun 17, 2022
by
patil-suraj
Browse files
update input names
parent
7dc71897
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
+4
-4
src/diffusers/models/unet.py
src/diffusers/models/unet.py
+4
-4
No files found.
src/diffusers/models/unet.py
View file @
eef2327a
...
@@ -287,14 +287,14 @@ class UNetModel(ModelMixin, ConfigMixin):
...
@@ -287,14 +287,14 @@ class UNetModel(ModelMixin, ConfigMixin):
self
.
norm_out
=
Normalize
(
block_in
)
self
.
norm_out
=
Normalize
(
block_in
)
self
.
conv_out
=
torch
.
nn
.
Conv2d
(
block_in
,
out_ch
,
kernel_size
=
3
,
stride
=
1
,
padding
=
1
)
self
.
conv_out
=
torch
.
nn
.
Conv2d
(
block_in
,
out_ch
,
kernel_size
=
3
,
stride
=
1
,
padding
=
1
)
def
forward
(
self
,
x
,
t
):
def
forward
(
self
,
x
,
t
imesteps
):
assert
x
.
shape
[
2
]
==
x
.
shape
[
3
]
==
self
.
resolution
assert
x
.
shape
[
2
]
==
x
.
shape
[
3
]
==
self
.
resolution
if
not
torch
.
is_tensor
(
t
):
if
not
torch
.
is_tensor
(
t
imesteps
):
t
=
torch
.
tensor
([
t
],
dtype
=
torch
.
long
,
device
=
x
.
device
)
t
imesteps
=
torch
.
tensor
([
t
imesteps
],
dtype
=
torch
.
long
,
device
=
x
.
device
)
# timestep embedding
# timestep embedding
temb
=
get_timestep_embedding
(
t
,
self
.
ch
)
temb
=
get_timestep_embedding
(
t
imesteps
,
self
.
ch
)
temb
=
self
.
temb
.
dense
[
0
](
temb
)
temb
=
self
.
temb
.
dense
[
0
](
temb
)
temb
=
nonlinearity
(
temb
)
temb
=
nonlinearity
(
temb
)
temb
=
self
.
temb
.
dense
[
1
](
temb
)
temb
=
self
.
temb
.
dense
[
1
](
temb
)
...
...
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