ZeroPad3d#
- class torch.nn.modules.padding.ZeroPad3d(padding)[源代码]#
用零填充输入张量边界。
对于 N 维填充,请使用
torch.nn.functional.pad()
。- 形状
输入: 或 。
输出: 或 ,其中
示例
>>> m = nn.ZeroPad3d(3) >>> input = torch.randn(16, 3, 10, 20, 30) >>> output = m(input) >>> # using different paddings for different sides >>> m = nn.ZeroPad3d((3, 3, 6, 6, 0, 1)) >>> output = m(input)