ConstantPad3d ¬
- class torch.nn.ConstantPad3d(填充, 值)[源代码][源代码] ¬
使用常数填充输入张量的边界。
对于 N 维填充,使用
torch.nn.functional.pad()
。- 参数:
填充(int,tuple)- 填充的大小。如果为 int,则在所有边界使用相同的填充。如果为 6 元组,则使用( , , , , , )。
- 形状:
输入: 或 。
输出: 或 ,其中
示例:
>>> m = nn.ConstantPad3d(3, 3.5) >>> input = torch.randn(16, 3, 10, 20, 30) >>> output = m(input) >>> # using different paddings for different sides >>> m = nn.ConstantPad3d((3, 3, 6, 6, 0, 1), 3.5) >>> output = m(input)