forked from mindspore-Ecosystem/mindspore
!26925 update api format
Merge pull request !26925 from yingchen/code_docs_api1129
This commit is contained in:
commit
03554c47ca
|
@ -5,7 +5,7 @@ mindspore.dataset.ImageFolderDataset
|
|||
|
||||
从树状结构的文件目录中读取图像作为源数据集,同一个文件夹中的所有图像都具有相同的标签。
|
||||
|
||||
生成的数据集有两列: :py:obj:`[image, label]`。列:py:obj:`image` 的数据为uint8类型,列:py:obj:`label` 的数据是uint32类型的标量。
|
||||
生成的数据集有两列:`[image, label]`。列: `image` 的数据为uint8类型,列: `label` 的数据是uint32类型的标量。
|
||||
|
||||
**参数:**
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
mindspore.dataset.MnistDataset
|
||||
===============================
|
||||
|
||||
.. py:class:: MnistDataset(dataset_dir, usage=None, num_samples=None, num_parallel_workers=None, shuffle=None, sampler=None, num_shards=None, shard_id=None, cache=None)
|
||||
.. py:class:: mindspore.dataset.MnistDataset(dataset_dir, usage=None, num_samples=None, num_parallel_workers=None, shuffle=None, sampler=None, num_shards=None, shard_id=None, cache=None)
|
||||
|
||||
用于读取和解析MNIST数据集的源数据集文件。
|
||||
|
||||
|
|
|
@ -15,7 +15,7 @@ mindspore.dataset.WeightedRandomSampler
|
|||
|
||||
>>> weights = [0.9, 0.01, 0.4, 0.8, 0.1, 0.1, 0.3]
|
||||
>>>
|
||||
>>> # 创建一个WeightedRandomSampler,在没有replacement的情况下对4个元素进行采样
|
||||
>>> # 创建一个WeightedRandomSampler,将对4个元素进行有放回采样
|
||||
>>> sampler = ds.WeightedRandomSampler(weights, 4)
|
||||
>>> dataset = ds.ImageFolderDataset(image_folder_dataset_dir,
|
||||
... num_parallel_workers=8,
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
|
||||
**参数:**
|
||||
|
||||
- **datasets** (tuple of class Dataset) - 输入元组格式的多个dataset对象。 `datasets` 参数的长度必须大于1。
|
||||
**datasets** (tuple of class Dataset) - 输入元组格式的多个dataset对象。 `datasets` 参数的长度必须大于1。
|
||||
|
||||
**返回:**
|
||||
|
||||
|
|
|
@ -27,8 +27,6 @@ mindspore.RowTensor
|
|||
|
||||
**样例:**
|
||||
|
||||
.. code-block::
|
||||
|
||||
>>> import mindspore as ms
|
||||
>>> import mindspore.nn as nn
|
||||
>>> from mindspore import RowTensor
|
||||
|
|
|
@ -23,8 +23,6 @@ mindspore.SparseTensor
|
|||
|
||||
**样例:**
|
||||
|
||||
.. code-block::
|
||||
|
||||
>>> import mindspore as ms
|
||||
>>> import mindspore.nn as nn
|
||||
>>> from mindspore import SparseTensor
|
||||
|
|
|
@ -18,8 +18,6 @@ mindspore.Tensor
|
|||
|
||||
**样例:**
|
||||
|
||||
.. code-block::
|
||||
|
||||
>>> import numpy as np
|
||||
>>> import mindspore as ms
|
||||
>>> from mindspore import Tensor
|
||||
|
@ -61,8 +59,6 @@ mindspore.Tensor
|
|||
|
||||
**样例:**
|
||||
|
||||
.. code-block::
|
||||
|
||||
>>> from mindspore import Tensor
|
||||
>>> a = Tensor([1.1, -2.1]).astype("float32")
|
||||
>>> output = a.abs()
|
||||
|
@ -89,8 +85,6 @@ mindspore.Tensor
|
|||
|
||||
**样例:**
|
||||
|
||||
.. code-block::
|
||||
|
||||
>>> from mindspore import Tensor
|
||||
>>> a = Tensor([True, True, False])
|
||||
>>> output = a.all()
|
||||
|
@ -116,8 +110,6 @@ mindspore.Tensor
|
|||
|
||||
**样例:**
|
||||
|
||||
.. code-block::
|
||||
|
||||
>>> from mindspore import Tensor
|
||||
>>> a = Tensor([True, True, False])
|
||||
>>> output = a.any()
|
||||
|
@ -139,7 +131,7 @@ mindspore.Tensor
|
|||
|
||||
**参数:**
|
||||
|
||||
- **x** (Tensor):输入的张量。该张量的形状必须遵守广播规则。
|
||||
**x** (Tensor):输入的张量。该张量的形状必须遵守广播规则。
|
||||
|
||||
**返回:**
|
||||
|
||||
|
@ -178,8 +170,6 @@ mindspore.Tensor
|
|||
|
||||
**样例:**
|
||||
|
||||
.. code-block::
|
||||
|
||||
>>> import numpy as np
|
||||
>>> from mindspore import Tensor
|
||||
>>> input_x = Tensor(np.array([1, 2, 3], dtype=np.float32))
|
||||
|
|
Loading…
Reference in New Issue