mindspore/docs/api/api_python/ops/mindspore.ops.func_squeeze.rst

22 lines
745 B
ReStructuredText
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

mindspore.ops.squeeze
=====================
.. py:function:: mindspore.ops.squeeze(input, axis=None)
删除输入tensor中长度为1的轴。
.. note::
- 请注意在动态图模式下输出tensor将与输入tensor共享数据并且没有tensor数据复制过程。
- 维度索引从0开始并且必须在 `[-input.ndim, input.ndim)` 范围内。
- 在GE模式下只支持对input shape中大小为1的维度进行压缩。
.. warning::
这是一个实验性API后续可能修改或删除。
参数:
- **input** (Tensor) - 输入tensor。
- **axis** (Union[int, tuple(int), list(int)]) - 待删除的轴,默认 ``None``
返回:
Tensor