oneflow.nn.AdaptiveAvgPool3d¶
-
class
oneflow.nn.
AdaptiveAvgPool3d
(output_size)¶ Applies a 3D adaptive average pooling over an input signal composed of several input planes.
The output is of size D x H x W, for any input size. The number of output features is equal to the number of input planes.
- Parameters
output_size – the target output size of the form D x H x W. Can be a tuple (D, H, W) or a single number D for a cube D x D x D. D, H and W can be either a
int
, orNone
which means the size will be the same as that of the input.
For example:
>>> import numpy as np >>> import oneflow as flow >>> import oneflow.nn as nn >>> m = nn.AdaptiveAvgPool3d((5,7,9)) >>> input = flow.Tensor(np.random.randn(1, 64, 8, 9, 10)) >>> output = m(input) >>> output.size() oneflow.Size([1, 64, 5, 7, 9]) >>> m = nn.AdaptiveAvgPool3d(7) >>> input = flow.Tensor(np.random.randn(1, 64, 10, 9, 8)) >>> output = m(input) >>> output.size() oneflow.Size([1, 64, 7, 7, 7]) >>> m = nn.AdaptiveAvgPool3d((7, None, None)) >>> input = flow.Tensor(np.random.randn(1, 64, 10, 9, 8)) >>> output = m(input) >>> output.size() oneflow.Size([1, 64, 7, 9, 8])