forked from huawei/mindspore2022
modify content order in rst
This commit is contained in:
parent
536c795fd2
commit
ffafb2ecbc
|
|
@ -164,22 +164,6 @@ mindspore.dataset.GraphData
|
|||
|
||||
**TypeError**:参数 `node_type` 的类型不为整型。
|
||||
|
||||
.. py:method:: get_edges_from_nodes(node_list)
|
||||
|
||||
从节点获取边。
|
||||
|
||||
**参数:**
|
||||
|
||||
- **node_list** (Union[list[tuple], numpy.ndarray]) - 含一个或多个图节点ID对的列表。
|
||||
|
||||
**返回:**
|
||||
|
||||
numpy.ndarray,含一个或多个边ID的数组。
|
||||
|
||||
**异常:**
|
||||
|
||||
**TypeError**:参数 `edge_list` 的类型不为列表或numpy.ndarray。
|
||||
|
||||
.. py:method:: get_edge_feature(edge_list, feature_types)
|
||||
|
||||
获取 `edge_list` 列表中边的特征,以 `feature_types` 类型返回。
|
||||
|
|
@ -198,6 +182,21 @@ mindspore.dataset.GraphData
|
|||
- **TypeError** - 参数 `edge_list` 的类型不为列表或numpy.ndarray。
|
||||
- **TypeError** - 参数 `feature_types` 的类型不为列表或numpy.ndarray。
|
||||
|
||||
.. py:method:: get_edges_from_nodes(node_list)
|
||||
|
||||
从节点获取边。
|
||||
|
||||
**参数:**
|
||||
|
||||
- **node_list** (Union[list[tuple], numpy.ndarray]) - 含一个或多个图节点ID对的列表。
|
||||
|
||||
**返回:**
|
||||
|
||||
numpy.ndarray,含一个或多个边ID的数组。
|
||||
|
||||
**异常:**
|
||||
|
||||
**TypeError**:参数 `edge_list` 的类型不为列表或numpy.ndarray。
|
||||
|
||||
.. py:method:: get_neg_sampled_neighbors(node_list, neg_neighbor_num, neg_neighbor_type)
|
||||
|
||||
|
|
@ -219,22 +218,6 @@ mindspore.dataset.GraphData
|
|||
- **TypeError** - 参数 `neg_neighbor_num` 的类型不为整型。
|
||||
- **TypeError** - 参数 `neg_neighbor_type` 的类型不为整型。
|
||||
|
||||
.. py:method:: get_nodes_from_edges(edge_list)
|
||||
|
||||
从图中的边获取节点。
|
||||
|
||||
**参数:**
|
||||
|
||||
- **edge_list** (Union[list, numpy.ndarray]) - 包含边的列表。
|
||||
|
||||
**返回:**
|
||||
|
||||
numpy.ndarray,包含节点的数组。
|
||||
|
||||
**异常:**
|
||||
|
||||
**TypeError** 参数 `edge_list` 不为列表或ndarray。
|
||||
|
||||
.. py:method:: get_node_feature(node_list, feature_types)
|
||||
|
||||
获取 `node_list` 中节点的特征,以 `feature_types` 类型返回。
|
||||
|
|
@ -253,6 +236,23 @@ mindspore.dataset.GraphData
|
|||
- **TypeError** - 参数 `node_list` 的类型不为列表或numpy.ndarray。
|
||||
- **TypeError** - 参数 `feature_types` 的类型不为列表或numpy.ndarray。
|
||||
|
||||
|
||||
.. py:method:: get_nodes_from_edges(edge_list)
|
||||
|
||||
从图中的边获取节点。
|
||||
|
||||
**参数:**
|
||||
|
||||
- **edge_list** (Union[list, numpy.ndarray]) - 包含边的列表。
|
||||
|
||||
**返回:**
|
||||
|
||||
numpy.ndarray,包含节点的数组。
|
||||
|
||||
**异常:**
|
||||
|
||||
**TypeError** 参数 `edge_list` 不为列表或ndarray。
|
||||
|
||||
.. py:method:: get_sampled_neighbors(node_list, neighbor_nums, neighbor_types, strategy=SamplingStrategy.RANDOM)
|
||||
|
||||
获取已采样相邻节点信息。此API支持多跳相邻节点采样。即将上一次采样结果作为下一跳采样的输入,最多允许6跳。采样结果平铺成列表,格式为[input node, 1-hop sampling result, 2-hop samling result ...]
|
||||
|
|
|
|||
|
|
@ -28,15 +28,6 @@ mindspore.dataset.text.transforms.JiebaTokenizer
|
|||
- **TypeError** - 参数 `hmm_path` 和 `mp_path` 类型不为string。
|
||||
- **TypeError** - 参数 `with_offsets` 类型不为bool。
|
||||
|
||||
.. py:method:: add_word(word, freq=None)
|
||||
|
||||
将用户定义的词添加到 JiebaTokenizer 的字典中。
|
||||
|
||||
**参数:**
|
||||
|
||||
- **word** (str) - 要添加到 JiebaTokenizer 词典中的单词,注意通过此接口添加的单词不会被写入本地的模型文件中。
|
||||
- **freq** (int,可选) - 要添加的单词的频率。频率越高,单词被分词的机会越大。默认值:None,使用默认频率。
|
||||
|
||||
.. py:method:: add_dict(user_dict)
|
||||
|
||||
将用户定义的词添加到 JiebaTokenizer 的字典中。
|
||||
|
|
@ -54,3 +45,12 @@ mindspore.dataset.text.transforms.JiebaTokenizer
|
|||
|
||||
也可以通过Python dict加载,要求的 Python 字典格式为:{word1:freq1, word2:freq2,...}。
|
||||
只有用户提供的文件中有效的词对才会被添加到字典中,无的效输入行将被忽略,且不返回错误或警告状态。
|
||||
|
||||
.. py:method:: add_word(word, freq=None)
|
||||
|
||||
将用户定义的词添加到 JiebaTokenizer 的字典中。
|
||||
|
||||
**参数:**
|
||||
|
||||
- **word** (str) - 要添加到 JiebaTokenizer 词典中的单词,注意通过此接口添加的单词不会被写入本地的模型文件中。
|
||||
- **freq** (int,可选) - 要添加的单词的频率。频率越高,单词被分词的机会越大。默认值:None,使用默认频率。
|
||||
|
|
|
|||
|
|
@ -19,30 +19,35 @@ mindspore.COOTensor
|
|||
|
||||
COOTensor,由 `indices` 、 `values` 和 `shape` 组成。
|
||||
|
||||
.. py:method:: indices
|
||||
:property:
|
||||
.. py:method:: abs()
|
||||
|
||||
返回COOTensor的索引值。
|
||||
对所有非零元素取绝对值,并返回新的COOTensor。
|
||||
|
||||
.. py:method:: values
|
||||
:property:
|
||||
**返回:**
|
||||
|
||||
返回COOTensor的非零元素值。
|
||||
CSRTensor。
|
||||
|
||||
.. py:method:: shape
|
||||
:property:
|
||||
.. py:method:: astype(dtype)
|
||||
|
||||
返回稀疏矩阵的稠密形状。
|
||||
返回指定数据类型的COOTensor。
|
||||
|
||||
**参数:**
|
||||
|
||||
- **dytpe** (`mindspore.dtype`) - 指定数据类型。
|
||||
|
||||
**返回:**
|
||||
|
||||
COOTensor。
|
||||
|
||||
.. py:method:: dtype
|
||||
:property:
|
||||
|
||||
返回稀疏矩阵非零元素值数据类型。
|
||||
|
||||
.. py:method:: size
|
||||
.. py:method:: indices
|
||||
:property:
|
||||
|
||||
返回稀疏矩阵非零元素值数量。
|
||||
返回COOTensor的索引值。
|
||||
|
||||
.. py:method:: itemsize
|
||||
:property:
|
||||
|
|
@ -54,6 +59,16 @@ mindspore.COOTensor
|
|||
|
||||
返回稀疏矩阵的稠密维度。
|
||||
|
||||
.. py:method:: shape
|
||||
:property:
|
||||
|
||||
返回稀疏矩阵的稠密形状。
|
||||
|
||||
.. py:method:: size
|
||||
:property:
|
||||
|
||||
返回稀疏矩阵非零元素值数量。
|
||||
|
||||
.. py:method:: to_csr()
|
||||
|
||||
将COOTensor转换为CSRTensor。
|
||||
|
|
@ -78,22 +93,7 @@ mindspore.COOTensor
|
|||
|
||||
tuple(Tensor, Tensor, tuple(int))
|
||||
|
||||
.. py:method:: abs()
|
||||
.. py:method:: values
|
||||
:property:
|
||||
|
||||
对所有非零元素取绝对值,并返回新的COOTensor。
|
||||
|
||||
**返回:**
|
||||
|
||||
CSRTensor。
|
||||
|
||||
.. py:method:: astype(dtype)
|
||||
|
||||
返回指定数据类型的COOTensor。
|
||||
|
||||
**参数:**
|
||||
|
||||
- **dytpe** (`mindspore.dtype`) - 指定数据类型。
|
||||
|
||||
**返回:**
|
||||
|
||||
COOTensor。
|
||||
返回COOTensor的非零元素值。
|
||||
|
|
|
|||
|
|
@ -21,46 +21,86 @@ mindspore.CSRTensor
|
|||
|
||||
CSRTensor,由 `indptr` 、 `indices` 、 `values` 和 `shape` 组成。
|
||||
|
||||
.. py:method:: indptr
|
||||
:property:
|
||||
.. py:method:: abs()
|
||||
|
||||
返回CSRTensor的行偏移量。
|
||||
对所有非零元素取绝对值,并返回新的CSRTensor。
|
||||
|
||||
.. py:method:: indices
|
||||
:property:
|
||||
**返回:**
|
||||
|
||||
返回CSRTensor的列索引值。
|
||||
CSRTensor。
|
||||
|
||||
.. py:method:: values
|
||||
:property:
|
||||
.. py:method:: astype(dtype)
|
||||
|
||||
返回CSRTensor的非零元素值。
|
||||
返回指定数据类型的CSRTensor。
|
||||
|
||||
.. py:method:: shape
|
||||
:property:
|
||||
**参数:**
|
||||
|
||||
返回稀疏矩阵的稠密形状。
|
||||
- **dytpe** (`mindspore.dtype`) - 指定数据类型。
|
||||
|
||||
**返回:**
|
||||
|
||||
CSRTensor。
|
||||
|
||||
.. py:method:: dtype
|
||||
:property:
|
||||
|
||||
返回稀疏矩阵非零元素值数据类型。
|
||||
|
||||
.. py:method:: size
|
||||
.. py:method:: indices
|
||||
:property:
|
||||
|
||||
返回稀疏矩阵非零元素值数量。
|
||||
返回CSRTensor的列索引值。
|
||||
|
||||
.. py:method:: indptr
|
||||
:property:
|
||||
|
||||
返回CSRTensor的行偏移量。
|
||||
|
||||
.. py:method:: itemsize
|
||||
:property:
|
||||
|
||||
返回每个非零元素所占字节数。
|
||||
|
||||
.. py:method:: mv(dense_vector)
|
||||
|
||||
返回CSRTensor右乘稠密矩阵的矩阵乘法运算结果。
|
||||
形状为 `[M, N]` 的CSRTensor,需要适配形状为 `[N, 1]` 的稠密向量,得到结果为 `[M, 1]` 的稠密向量。
|
||||
|
||||
**参数:**
|
||||
|
||||
- **dense_vector** (Tensor) - 形状为 `[N,1]` 的一维张量,其中N等于CSRTensor的列数。
|
||||
|
||||
**返回:**
|
||||
|
||||
Tensor。
|
||||
|
||||
.. py:method:: ndim
|
||||
:property:
|
||||
|
||||
稀疏矩阵的稠密维度。
|
||||
|
||||
.. py:method:: shape
|
||||
:property:
|
||||
|
||||
返回稀疏矩阵的稠密形状。
|
||||
|
||||
.. py:method:: size
|
||||
:property:
|
||||
|
||||
返回稀疏矩阵非零元素值数量。
|
||||
|
||||
.. py:method:: sum(axis)
|
||||
|
||||
对CSRTensor的某个轴求和。
|
||||
|
||||
**参数:**
|
||||
|
||||
- **axis** (int) - 求和轴。
|
||||
|
||||
**返回:**
|
||||
|
||||
Tensor。
|
||||
|
||||
.. py:method:: to_coo()
|
||||
|
||||
将CSRTensor转换为COOTensor。
|
||||
|
|
@ -85,47 +125,7 @@ mindspore.CSRTensor
|
|||
|
||||
tuple(Tensor,Tensor, Tensor, tuple(int))
|
||||
|
||||
.. py:method:: abs()
|
||||
.. py:method:: values
|
||||
:property:
|
||||
|
||||
对所有非零元素取绝对值,并返回新的CSRTensor。
|
||||
|
||||
**返回:**
|
||||
|
||||
CSRTensor。
|
||||
|
||||
.. py:method:: astype(dtype)
|
||||
|
||||
返回指定数据类型的CSRTensor。
|
||||
|
||||
**参数:**
|
||||
|
||||
- **dytpe** (`mindspore.dtype`) - 指定数据类型。
|
||||
|
||||
**返回:**
|
||||
|
||||
CSRTensor。
|
||||
|
||||
.. py:method:: mv(dense_vector)
|
||||
|
||||
返回CSRTensor右乘稠密矩阵的矩阵乘法运算结果。
|
||||
形状为 `[M, N]` 的CSRTensor,需要适配形状为 `[N, 1]` 的稠密向量,得到结果为 `[M, 1]` 的稠密向量。
|
||||
|
||||
**参数:**
|
||||
|
||||
- **dense_vector** (Tensor) - 形状为 `[N,1]` 的一维张量,其中N等于CSRTensor的列数。
|
||||
|
||||
**返回:**
|
||||
|
||||
Tensor。
|
||||
|
||||
.. py:method:: sum(axis)
|
||||
|
||||
对CSRTensor的某个轴求和。
|
||||
|
||||
**参数:**
|
||||
|
||||
- **axis** (int) - 求和轴。
|
||||
|
||||
**返回:**
|
||||
|
||||
Tensor。
|
||||
返回CSRTensor的非零元素值。
|
||||
|
|
|
|||
|
|
@ -18,14 +18,6 @@ mindspore.ops.Primitive
|
|||
- **name** (str) - 属性名称。
|
||||
- **value** (Any) - 属性值。
|
||||
|
||||
.. py:method:: del_prim_attr(name)
|
||||
|
||||
删除Primitive的属性。
|
||||
|
||||
**参数:**
|
||||
|
||||
- **name** (str) - 属性名称。
|
||||
|
||||
.. py:method:: check_elim(*args)
|
||||
|
||||
检查是否可以消除此Primitive。有需要的子类可以重写该方法。
|
||||
|
|
@ -38,6 +30,14 @@ mindspore.ops.Primitive
|
|||
|
||||
由两个元素组成的元组。第一个元素是指是否能在编译阶段计算Primitive,第二个元素是计算结果。
|
||||
|
||||
.. py:method:: del_prim_attr(name)
|
||||
|
||||
删除Primitive的属性。
|
||||
|
||||
**参数:**
|
||||
|
||||
- **name** (str) - 属性名称。
|
||||
|
||||
.. py:method:: init_prim_io_names(inputs, outputs)
|
||||
|
||||
初始化Tensor或属性的输入输出的名称。
|
||||
|
|
|
|||
Loading…
Reference in New Issue