mindspore/docs/api/api_python/ops/mindspore.ops.SparseToDense...

19 lines
964 B
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.SparseToDense
============================
.. py:class:: mindspore.ops.SparseToDense
将稀疏Tensor转换为密集Tensor。
输入:
- **indices** (Tensor) - 二维Tensor表示元素在稀疏Tensor中的位置。支持int32、int64每个元素值都应该是非负的。shape是 :math:`(n,2)`
- **values** (Tensor) - 一维Tensor表示 `indices` 位置上对应的值。shape为 :math:`(n,)`
- **sparse_shape** (tuple(int)) - 指定稀疏Tensor的shape由两个正整数组成表示稀疏Tensor的shape为 :math:`(N, C)`
返回:
Tensor计算后的Tensor。数据类型与 `values` 相同shape由 `sparse_shape` 所指定。
异常:
- **TypeError** - 如果 `indices` 的数据类型既不是int32也不是int64。
- **ValueError** - 如果 `sparse_shape``indices``values` 的shape不符合参数中所描述支持的数据类型。