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

30 lines
1.6 KiB
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.SparseSlice
==========================
.. py:class:: mindspore.ops.SparseSlice
基于 `start``size` 对稀疏Tensor进行切片。
输入:
- **indices** (Tensor) - 稀疏Tensor的索引是一个二维Tensor(N乘R的矩阵)shape为 :math:`(N, R)` 。支持的数据类型为int64其每一个值都必须是非负整数。
- **values** (Tensor)- 稀疏Tensor `indices` 对应位置的值是一个一维Tensorshape为 :math:`(N,)`
- **shape** (Tensor) - 稀疏Tensor的shape是一个一维Tensorshape为 :math:`(R,)` 数据类型为int64。
- **start** (Tensor) - 切片操作起始位置是一个一维Tensorshape为 :math:`(R,)` 数据类型为int64。
- **size** (Tensor) - 切片的尺寸是一个一维Tensorshape为 :math:`(R,)` 数据类型为int64。
输出:
切片操作生成一个 `SparseTensor` 对象。
- y_indices: int64类型的Tensor。
- y_values: 数据类型与 `values` 相同的Tensor.
- y_shape: int64类型的Tensor其大小与 `size` 相同。
异常:
- **TypeError** - `indices``shape``start``size` 不是int64数据类型。
- **ValueError** - `indices` 不是2维Tensor。
- **ValueError** - `values``start``shape``size` 不是一维Tensor。
- **ValueError** - `indices``values` 对应元素数量不一致。
- **ValueError** - `indices[1]``shape` 的shape不一致。
- **ValueError** - `shape``start` 的shape不一致。
- **ValueError** - `shape``size` git的shape不一致。