用法:
class torch.nn.ConstantPad3d(padding, value)
用一个常数值填充输入张量边界。
对于
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)
相关用法
- Python torch.nn.ConstantPad2d用法及代码示例
- Python torch.nn.ConstantPad1d用法及代码示例
- Python torch.nn.Conv3d用法及代码示例
- Python torch.nn.ConvTranspose2d用法及代码示例
- Python torch.nn.ConvTranspose3d用法及代码示例
- Python torch.nn.Conv1d用法及代码示例
- Python torch.nn.Conv2d用法及代码示例
- Python torch.nn.CosineSimilarity用法及代码示例
- Python torch.nn.CELU用法及代码示例
- Python torch.nn.ChannelShuffle用法及代码示例
- Python torch.nn.CTCLoss用法及代码示例
- Python torch.nn.CrossEntropyLoss用法及代码示例
- Python torch.nn.InstanceNorm3d用法及代码示例
- Python torch.nn.quantized.dynamic.LSTM用法及代码示例
- Python torch.nn.EmbeddingBag用法及代码示例
- Python torch.nn.Module.register_forward_hook用法及代码示例
- Python torch.nn.AvgPool2d用法及代码示例
- Python torch.nn.PixelShuffle用法及代码示例
- Python torch.nn.Hardsigmoid用法及代码示例
- Python torch.nn.GLU用法及代码示例
- Python torch.nn.functional.conv1d用法及代码示例
- Python torch.nn.Identity用法及代码示例
- Python torch.nn.Sigmoid用法及代码示例
- Python torch.nn.utils.spectral_norm用法及代码示例
- Python torch.nn.utils.prune.custom_from_mask用法及代码示例
注:本文由纯净天空筛选整理自pytorch.org大神的英文原创作品 torch.nn.ConstantPad3d。非经特殊声明,原始代码版权归原作者所有,本译文未经允许或授权,请勿转载或复制。