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

32 lines
2.0 KiB
ReStructuredText
Raw 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.Coalesce
=======================
.. py:class:: mindspore.ops.Coalesce
返回输入的合并稀疏Tensor。
输入:
- **x_indices** (Tensor) - 二维Tensor表示稀疏Tensor中非零元素的索引所有元素的取值都是非负的。数据类型为int64。
其shape可表示为 :math:`(y, x)`
- **x_values** (Tensor) - 一维Tensor表示与 `y_indices` 中的索引对应的值。支持的数据类型为float16、float32。
其shape可表示为 :math:`(x,)`
- **x_shape** (Tensor) - 一维Tensor代表稀疏Tensor的shape。数据类型为int64。
其shape可表示为 :math:`(y,)`
输出:
- **y_indices** (Tensor) - 二维Tensor表示稀疏Tensor中非零元素的索引所有元素的取值都是非负的。数据类型为int64。
其shape可表示为 :math:`(y, z)` `z` 代表 `x_indices` 中不同索引的数量。
- **y_values** (Tensor) - 一维Tensor表示与 `y_indices` 中的索引对应的值。数据类型与 `x_values` 保持一致。
其shape可表示为 :math:`(z,)`
- **y_shape** (Tensor) - 一维Tensor代表稀疏Tensor的shape。数据类型为int64。
其shape可表示为 :math:`(y,)`
异常:
- **TypeError** - 输入 `x_values` 的数据类型不是float32或float16之一。
- **TypeError** - 输入 `x_indices``x_shape` 中存在数据类型不是int64的取值。
- **ValueError** - `x_values``x_shape` 不是一维Tensor。
- **ValueError** - `x_indices` 不是一个二维Tensor。
- **ValueError** - `x_indices` 第二个维度的大小和 `x_values` 第一个维度的大小不一致。
- **ValueError** - `x_indices` 第一个维度的大小和 `x_shape` 第一个维度的大小不一致。
- **ValueError** - `x_indices` 中存在负数。
- **ValueError** - `x_indices` 中存在元素取值超过了 `x_shape` 的限制。