Rate this Page
★★★★★
ZeroPad3d#
- classtorch.nn.ZeroPad3d(padding)[source]#
Pads the input tensor boundaries with zero.
ForN-dimensional padding, use
torch.nn.functional.pad().- Parameters
padding (int,tuple) – the size of the padding. If isint, uses the samepadding in all boundaries. If a 6-tuple, uses(,,,,,)
- Shape:
Input: or.
Output: or, where
Examples:
>>>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)
On this page