mindspore/docs/api/api_python/ops/mindspore.ops.SparseTensorD...

22 lines
1.0 KiB
ReStructuredText
Raw Permalink Normal View History

2022-09-01 20:59:30 +08:00
mindspore.ops.SparseTensorDenseAdd
==================================
.. py:class:: mindspore.ops.SparseTensorDenseAdd
2022-11-02 19:28:41 +08:00
一个稀疏tensor加上稠密Tensor得到一个稠密Tensor。
2022-09-01 20:59:30 +08:00
输入:
2023-02-13 14:40:11 +08:00
- **x1_indices** (Tensor) - 二维Tensor表示稀疏Tensor的索引位置shape为 :math:`(n, ndim)`
支持的数据类型为int32和int64其值必须为非负数。
2022-11-02 19:28:41 +08:00
- **x1_values** (Tensor) - 一维Tensor表示稀疏Tensor索引位置对应值shape为 :math:`(n,)`
2023-02-13 14:40:11 +08:00
- **x1_shape** (tuple(int)) - 稀疏Tensor对应的稠密Tensor的shape是一个不含负数 长度为ndim的tuple
shape为 :math:`(ndim,)`
2022-11-02 19:28:41 +08:00
- **x2** (Tensor) - 稠密Tensor数据类型与稀疏Tensor一致。
2022-09-01 20:59:30 +08:00
输出:
2022-11-02 19:28:41 +08:00
Tensorshape与 `x1_shape` 一致。
2022-09-01 20:59:30 +08:00
异常:
- **TypeError** - `x1_indices``x1_shape` 不是int32或者int64。
- **ValueError** - `x1_shape` 的shape `x1_indices` 的shape `x1_values` 的shape和 `x2` 的shape不满足参数描述。