mindspore/docs/api/api_python/ops/mindspore.ops.func_combinat...

16 lines
668 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.combinations
==========================
.. py:function:: mindspore.ops.combinations(input, r=2, with_replacement=False)
返回输入tensor中所有长度为 `r` 的子序列。
`with_replacement```False``功能与Python的 `itertools.combinations` 类似;当为 ``True`` 时,功能与 `itertools.combinations_with_replacement` 一致。
参数:
- **input** (Tensor) - 一维输入tensor。
- **r** (int可选) - 进行组合的子序列长度。默认 ``2``
- **with_replacement** (bool可选) - 是否允许组合存在重复值。默认 ``False``
返回:
Tensor