Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
OpenDAS
diffusers
Commits
754fac82
Unverified
Commit
754fac82
authored
May 16, 2023
by
Laureηt
Committed by
GitHub
May 16, 2023
Browse files
[Docs] Fix incomplete docstring for resnet.py (#3438)
Fix incomplete docstrings for resnet.py
parent
17f9aed7
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
62 additions
and
24 deletions
+62
-24
src/diffusers/models/resnet.py
src/diffusers/models/resnet.py
+62
-24
No files found.
src/diffusers/models/resnet.py
View file @
754fac82
...
...
@@ -24,14 +24,17 @@ from .attention import AdaGroupNorm
class
Upsample1D
(
nn
.
Module
):
"""
An upsampling layer with an optional convolution.
"""A 1D upsampling layer with an optional convolution.
Parameters:
channels: channels in the inputs and outputs.
use_conv: a bool determining if a convolution is applied.
use_conv_transpose:
out_channels:
channels (`int`):
number of channels in the inputs and outputs.
use_conv (`bool`, default `False`):
option to use a convolution.
use_conv_transpose (`bool`, default `False`):
option to use a convolution transpose.
out_channels (`int`, optional):
number of output channels. Defaults to `channels`.
"""
def
__init__
(
self
,
channels
,
use_conv
=
False
,
use_conv_transpose
=
False
,
out_channels
=
None
,
name
=
"conv"
):
...
...
@@ -62,14 +65,17 @@ class Upsample1D(nn.Module):
class
Downsample1D
(
nn
.
Module
):
"""
A downsampling layer with an optional convolution.
"""A 1D downsampling layer with an optional convolution.
Parameters:
channels: channels in the inputs and outputs.
use_conv: a bool determining if a convolution is applied.
out_channels:
padding:
channels (`int`):
number of channels in the inputs and outputs.
use_conv (`bool`, default `False`):
option to use a convolution.
out_channels (`int`, optional):
number of output channels. Defaults to `channels`.
padding (`int`, default `1`):
padding for the convolution.
"""
def
__init__
(
self
,
channels
,
use_conv
=
False
,
out_channels
=
None
,
padding
=
1
,
name
=
"conv"
):
...
...
@@ -93,14 +99,17 @@ class Downsample1D(nn.Module):
class
Upsample2D
(
nn
.
Module
):
"""
An upsampling layer with an optional convolution.
"""A 2D upsampling layer with an optional convolution.
Parameters:
channels: channels in the inputs and outputs.
use_conv: a bool determining if a convolution is applied.
use_conv_transpose:
out_channels:
channels (`int`):
number of channels in the inputs and outputs.
use_conv (`bool`, default `False`):
option to use a convolution.
use_conv_transpose (`bool`, default `False`):
option to use a convolution transpose.
out_channels (`int`, optional):
number of output channels. Defaults to `channels`.
"""
def
__init__
(
self
,
channels
,
use_conv
=
False
,
use_conv_transpose
=
False
,
out_channels
=
None
,
name
=
"conv"
):
...
...
@@ -162,14 +171,17 @@ class Upsample2D(nn.Module):
class
Downsample2D
(
nn
.
Module
):
"""
A downsampling layer with an optional convolution.
"""A 2D downsampling layer with an optional convolution.
Parameters:
channels: channels in the inputs and outputs.
use_conv: a bool determining if a convolution is applied.
out_channels:
padding:
channels (`int`):
number of channels in the inputs and outputs.
use_conv (`bool`, default `False`):
option to use a convolution.
out_channels (`int`, optional):
number of output channels. Defaults to `channels`.
padding (`int`, default `1`):
padding for the convolution.
"""
def
__init__
(
self
,
channels
,
use_conv
=
False
,
out_channels
=
None
,
padding
=
1
,
name
=
"conv"
):
...
...
@@ -209,6 +221,19 @@ class Downsample2D(nn.Module):
class
FirUpsample2D
(
nn
.
Module
):
"""A 2D FIR upsampling layer with an optional convolution.
Parameters:
channels (`int`):
number of channels in the inputs and outputs.
use_conv (`bool`, default `False`):
option to use a convolution.
out_channels (`int`, optional):
number of output channels. Defaults to `channels`.
fir_kernel (`tuple`, default `(1, 3, 3, 1)`):
kernel for the FIR filter.
"""
def
__init__
(
self
,
channels
=
None
,
out_channels
=
None
,
use_conv
=
False
,
fir_kernel
=
(
1
,
3
,
3
,
1
)):
super
().
__init__
()
out_channels
=
out_channels
if
out_channels
else
channels
...
...
@@ -309,6 +334,19 @@ class FirUpsample2D(nn.Module):
class
FirDownsample2D
(
nn
.
Module
):
"""A 2D FIR downsampling layer with an optional convolution.
Parameters:
channels (`int`):
number of channels in the inputs and outputs.
use_conv (`bool`, default `False`):
option to use a convolution.
out_channels (`int`, optional):
number of output channels. Defaults to `channels`.
fir_kernel (`tuple`, default `(1, 3, 3, 1)`):
kernel for the FIR filter.
"""
def
__init__
(
self
,
channels
=
None
,
out_channels
=
None
,
use_conv
=
False
,
fir_kernel
=
(
1
,
3
,
3
,
1
)):
super
().
__init__
()
out_channels
=
out_channels
if
out_channels
else
channels
...
...
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