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
OpenDAS
diffusers
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
Hide 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):
or
isinstance
(
timestep
,
torch
.
IntTensor
)
or
isinstance
(
timestep
,
torch
.
LongTensor
)
):
warnings
.
warn
(
"Integer timesteps in `LMSDiscreteScheduler.step()` are deprecated and will be removed in version"
" 0.5.0. Make sure to pass one of the `scheduler.timesteps`."
deprecate
(
"timestep as an index"
,
"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
else
:
...
...
@@ -257,9 +261,13 @@ class LMSDiscreteScheduler(SchedulerMixin, ConfigMixin):
schedule_timesteps
=
self
.
timesteps
.
to
(
original_samples
.
device
)
timesteps
=
timesteps
.
to
(
original_samples
.
device
)
if
isinstance
(
timesteps
,
torch
.
IntTensor
)
or
isinstance
(
timesteps
,
torch
.
LongTensor
):
warnings
.
warn
(
"Integer timesteps in `LMSDiscreteScheduler.add_noise()` are deprecated and will be removed in"
" version 0.5.0. Make sure to pass values from `scheduler.timesteps`."
deprecate
(
"timesteps as indices"
,
"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
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