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
chenpangpang
ComfyUI
Commits
8ddc151a
Commit
8ddc151a
authored
Jun 16, 2024
by
comfyanonymous
Browse files
Squash depreciation warning on new pytorch.
parent
ca9d300a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
2 deletions
+8
-2
comfy/ldm/audio/autoencoder.py
comfy/ldm/audio/autoencoder.py
+8
-2
No files found.
comfy/ldm/audio/autoencoder.py
View file @
8ddc151a
...
@@ -75,10 +75,16 @@ class SnakeBeta(nn.Module):
...
@@ -75,10 +75,16 @@ class SnakeBeta(nn.Module):
return
x
return
x
def
WNConv1d
(
*
args
,
**
kwargs
):
def
WNConv1d
(
*
args
,
**
kwargs
):
return
torch
.
nn
.
utils
.
weight_norm
(
ops
.
Conv1d
(
*
args
,
**
kwargs
))
try
:
return
torch
.
nn
.
utils
.
parametrizations
.
weight_norm
(
ops
.
Conv1d
(
*
args
,
**
kwargs
))
except
:
return
torch
.
nn
.
utils
.
weight_norm
(
ops
.
Conv1d
(
*
args
,
**
kwargs
))
#support pytorch 2.1 and older
def
WNConvTranspose1d
(
*
args
,
**
kwargs
):
def
WNConvTranspose1d
(
*
args
,
**
kwargs
):
return
torch
.
nn
.
utils
.
weight_norm
(
ops
.
ConvTranspose1d
(
*
args
,
**
kwargs
))
try
:
return
torch
.
nn
.
utils
.
parametrizations
.
weight_norm
(
ops
.
ConvTranspose1d
(
*
args
,
**
kwargs
))
except
:
return
torch
.
nn
.
utils
.
weight_norm
(
ops
.
ConvTranspose1d
(
*
args
,
**
kwargs
))
#support pytorch 2.1 and older
def
get_activation
(
activation
:
Literal
[
"elu"
,
"snake"
,
"none"
],
antialias
=
False
,
channels
=
None
)
->
nn
.
Module
:
def
get_activation
(
activation
:
Literal
[
"elu"
,
"snake"
,
"none"
],
antialias
=
False
,
channels
=
None
)
->
nn
.
Module
:
if
activation
==
"elu"
:
if
activation
==
"elu"
:
...
...
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