ConstantPad3d#
- class torch.nn.ConstantPad3d(padding, value)[source]#
用常數值填充輸入張量邊界。
對於 N 維填充,請使用
torch.nn.functional.pad()。- 形狀
輸入: 或 。
輸出: 或 ,其中
示例
>>> 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)