mindspore/docs/api/api_python/nn/mindspore.nn.AdaptiveMaxPoo...

31 lines
1.4 KiB
ReStructuredText
Raw Normal View History

mindspore.nn.AdaptiveMaxPool1d
2022-05-23 12:55:26 +08:00
==============================
2023-02-23 10:04:43 +08:00
.. py:class:: mindspore.nn.AdaptiveMaxPool1d(output_size, return_indices=False)
2022-12-29 16:33:21 +08:00
在一个输入Tensor上应用1D自适应最大池化运算可被视为组成一个1D输入平面。
2022-09-09 10:11:19 +08:00
2023-02-17 11:32:08 +08:00
通常输入的shape为 :math:`(N_{in}, C_{in}, L_{in})`:math:`(C_{in}, L_{in})`
输出的shape为 :math:`(N_{in}, C_{in}, L_{out})`:math:`(C_{in}, L_{out})` ,其中 :math:`L_{out}``output_size` 定义。
.. note::
2023-02-17 11:32:08 +08:00
Ascend平台不支持 `return_indices` 参数。
2022-07-22 16:25:38 +08:00
参数:
2023-02-17 11:32:08 +08:00
- **output_size** (int) - 目标输出大小 :math:`L_{out}`
- **return_indices** (bool) - 如果为True输出最大值的索引默认值为False。
2022-07-22 16:25:38 +08:00
输入:
2023-02-17 11:32:08 +08:00
- **input** (Tensor) - 输入shape为 :math:`(N_{in}, C_{in}, L_{in})`:math:`(C_{in}, L_{in})` 数据类型为float16、float32。
2022-07-22 16:25:38 +08:00
输出:
2023-02-17 11:32:08 +08:00
Tensor数据类型与 `input` 相同。
输出的shape为 :math:`(N_{in}, C_{in}, L_{out})`:math:`(C_{in}, L_{out})`
2022-07-22 16:25:38 +08:00
异常:
2023-02-17 11:32:08 +08:00
- **TypeError** - 如果 `input` 不是Tensor。
- **TypeError** - 如果 `output_size` 不是int类型。
- **TypeError** - 如果 `return_indices` 不是bool类型。
- **ValueError** - 如果 `output_size` 小于1。
- **ValueError** - 如果 `input` 的维度不等于2或3。