Skip to content

Commit 6ebb15e

Browse files
committed
wheneuxan: update the utils
1 parent ca6f94c commit 6ebb15e

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

channel_attention/utils.py

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,20 @@ def create_conv_layer(
1212
bias: bool = True,
1313
groups: int = 1,
1414
) -> nn.Module:
15-
"""Create a convolutional layer based on the number of dimensions."""
15+
"""
16+
Create a convolutional layer based on the number of dimensions.
17+
18+
:param n_dims: The number of dimensions (1 or 2).
19+
:param in_channels: Number of input channels.
20+
:param out_channels: Number of output channels.
21+
:param kernel_size: Size of the convolutional kernel.
22+
:param stride: Stride of the convolution. Default is 1.
23+
:param padding: Padding added to both sides of the input. Default is 0.
24+
:param bias: If True, adds a learnable bias to the output. Default is True.
25+
:param groups: Number of blocked connections from input channels to output channels. Default is 1.
26+
27+
:return: A convolutional layer (nn.Conv1d or nn.Conv2d).
28+
"""
1629
if n_dims == 1:
1730
return nn.Conv1d(
1831
in_channels=in_channels,

0 commit comments

Comments
 (0)