mindspore.mint.nn.functional.adaptive_avg_pool1d
- mindspore.mint.nn.functional.adaptive_avg_pool1d(input, output_size)[source]
Performs 1D adaptive average pooling on a multi-plane input signal. That is, for any input size, the size of the specified output is L. The number of output features is equal to the number of input features.
Warning
This is an experimental API that is subject to change or deletion.
- Parameters
- Returns
Tensor, with the same type as the input.
Shape of the output is input_shape[:len(input_shape) - 1] + [output_size].
- Raises
ValueError – If output_size is not integer.
TypeError – If input is not a Tensor.
TypeError – If dtype of input is not float16, float32.
- Supported Platforms:
Ascend
Examples
>>> import mindspore >>> from mindspore import Tensor, mint >>> input = Tensor([[2,3],[3,4]],dtype=mindspore.float16) >>> output = mint.nn.functional.adaptive_avg_pool1d(input, 3) >>> print(output) [[2. 2.5 3. ] [3. 3.5 4. ]]