LazyConv1d
-
class torch.nn.LazyConv1d(out_channels, kernel_size, stride=1, padding=0, dilation=1, groups=1, bias=True, padding_mode='zeros', device=None, dtype=None)[source][source]
一个 torch.nn.Conv1d
模块,其 in_channels
参数采用延迟初始化。
Conv1d
的 in_channels
参数通过 input.size(1)
推断得出。将被延迟初始化的属性是 weight 和 bias。
请查阅 torch.nn.modules.lazy.LazyModuleMixin
,以获取关于延迟模块及其限制的更多文档。
- 参数
out_channels (int) – 卷积产生的输出通道数
kernel_size (int 或 tuple) – 卷积核大小
stride (int 或 tuple, 可选) – 卷积步长。默认值:1
padding (int 或 tuple, 可选) – 输入两侧添加的零填充。默认值:0
dilation (int 或 tuple, 可选) – 卷积核元素之间的间距。默认值:1
groups (int, 可选) – 从输入通道到输出通道的连接组数。默认值:1
bias (bool, 可选) – 如果为 True
,则为输出添加可学习的偏置。默认值:True
padding_mode (str, 可选) – 'zeros'
, 'reflect'
, 'replicate'
或 'circular'
。默认值:'zeros'
-
cls_to_become[source]
torch.nn.modules.conv.Conv1d 的别名