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
08839682
Unverified
Commit
08839682
authored
Oct 06, 2022
by
Anton Lozhkov
Committed by
GitHub
Oct 06, 2022
Browse files
Better steps deprecation for LMS (#753)
* Better steps deprecation for LMS * upd
parent
6c647419
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
6 deletions
+14
-6
src/diffusers/schedulers/scheduling_lms_discrete.py
src/diffusers/schedulers/scheduling_lms_discrete.py
+14
-6
No files found.
src/diffusers/schedulers/scheduling_lms_discrete.py
View file @
08839682
...
@@ -215,9 +215,13 @@ class LMSDiscreteScheduler(SchedulerMixin, ConfigMixin):
...
@@ -215,9 +215,13 @@ class LMSDiscreteScheduler(SchedulerMixin, ConfigMixin):
or
isinstance
(
timestep
,
torch
.
IntTensor
)
or
isinstance
(
timestep
,
torch
.
IntTensor
)
or
isinstance
(
timestep
,
torch
.
LongTensor
)
or
isinstance
(
timestep
,
torch
.
LongTensor
)
):
):
warnings
.
warn
(
deprecate
(
"Integer timesteps in `LMSDiscreteScheduler.step()` are deprecated and will be removed in version"
"timestep as an index"
,
" 0.5.0. Make sure to pass one of the `scheduler.timesteps`."
"0.5.0"
,
"Passing integer indices (e.g. from `enumerate(timesteps)`) as timesteps to"
" `LMSDiscreteScheduler.step()` will not be supported in future versions. Make sure to pass"
" one of the `scheduler.timesteps` as a timestep."
,
standard_warn
=
False
,
)
)
step_index
=
timestep
step_index
=
timestep
else
:
else
:
...
@@ -257,9 +261,13 @@ class LMSDiscreteScheduler(SchedulerMixin, ConfigMixin):
...
@@ -257,9 +261,13 @@ class LMSDiscreteScheduler(SchedulerMixin, ConfigMixin):
schedule_timesteps
=
self
.
timesteps
.
to
(
original_samples
.
device
)
schedule_timesteps
=
self
.
timesteps
.
to
(
original_samples
.
device
)
timesteps
=
timesteps
.
to
(
original_samples
.
device
)
timesteps
=
timesteps
.
to
(
original_samples
.
device
)
if
isinstance
(
timesteps
,
torch
.
IntTensor
)
or
isinstance
(
timesteps
,
torch
.
LongTensor
):
if
isinstance
(
timesteps
,
torch
.
IntTensor
)
or
isinstance
(
timesteps
,
torch
.
LongTensor
):
warnings
.
warn
(
deprecate
(
"Integer timesteps in `LMSDiscreteScheduler.add_noise()` are deprecated and will be removed in"
"timesteps as indices"
,
" version 0.5.0. Make sure to pass values from `scheduler.timesteps`."
"0.5.0"
,
"Passing integer indices (e.g. from `enumerate(timesteps)`) as timesteps to"
" `LMSDiscreteScheduler.add_noise()` will not be supported in future versions. Make sure to"
" pass values from `scheduler.timesteps` as timesteps."
,
standard_warn
=
False
,
)
)
step_indices
=
timesteps
step_indices
=
timesteps
else
:
else
:
...
...
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