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
ModelZoo
stylegan3_pytorch
Commits
451b975a
Commit
451b975a
authored
Aug 27, 2024
by
mashun1
Browse files
Update filtered_lrelu.py
parent
0bf49494
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
torch_utils/ops/filtered_lrelu.py
torch_utils/ops/filtered_lrelu.py
+2
-2
No files found.
torch_utils/ops/filtered_lrelu.py
View file @
451b975a
...
...
@@ -110,8 +110,8 @@ def filtered_lrelu(x, fu=None, fd=None, b=None, up=1, down=1, padding=0, gain=np
"""
assert
isinstance
(
x
,
torch
.
Tensor
)
assert
impl
in
[
'ref'
,
'cuda'
]
if
impl
==
'cuda'
and
x
.
device
.
type
==
'cuda'
and
_init
():
return
_filtered_lrelu_cuda
(
up
=
up
,
down
=
down
,
padding
=
padding
,
gain
=
gain
,
slope
=
slope
,
clamp
=
clamp
,
flip_filter
=
flip_filter
).
apply
(
x
,
fu
,
fd
,
b
,
None
,
0
,
0
)
#
if impl == 'cuda' and x.device.type == 'cuda' and _init():
#
return _filtered_lrelu_cuda(up=up, down=down, padding=padding, gain=gain, slope=slope, clamp=clamp, flip_filter=flip_filter).apply(x, fu, fd, b, None, 0, 0)
return
_filtered_lrelu_ref
(
x
,
fu
=
fu
,
fd
=
fd
,
b
=
b
,
up
=
up
,
down
=
down
,
padding
=
padding
,
gain
=
gain
,
slope
=
slope
,
clamp
=
clamp
,
flip_filter
=
flip_filter
)
#----------------------------------------------------------------------------
...
...
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