AdaptiveMaxPool3d#
- class torch.nn.AdaptiveMaxPool3d(output_size, return_indices=False)[源码]#
对由多个输入平面组成的输入信号应用 3D 自适应最大池化。
对于任何输入尺寸,输出尺寸为 . 输出的通道数与输入的通道数相同。
- 参数
output_size (Union[int, None, tuple[Optional[int], Optional[int], Optional[int]]) – 目标图像输出尺寸,形式为 . 可以是元组 或单个 表示一个立方体 . , and can be either an
int
, orNone
, which means the size will be the same as that of the input.return_indices (bool) – if
True
, will return the indices along with the outputs. Useful to pass to nn.MaxUnpool3d. Default:False
- 形状
Input: or .
Output: or , where .
示例
>>> # target output size of 5x7x9 >>> m = nn.AdaptiveMaxPool3d((5, 7, 9)) >>> input = torch.randn(1, 64, 8, 9, 10) >>> output = m(input) >>> # target output size of 7x7x7 (cube) >>> m = nn.AdaptiveMaxPool3d(7) >>> input = torch.randn(1, 64, 10, 9, 8) >>> output = m(input) >>> # target output size of 7x9x8 >>> m = nn.AdaptiveMaxPool3d((7, None, None)) >>> input = torch.randn(1, 64, 10, 9, 8) >>> output = m(input)