Browse Source

!32602 [MD] fix doc issue in master

Merge pull request !32602 from liyong126/code_docs_fix_doc_issue
pull/1/head
i-robot Gitee 3 years ago
parent
commit
58c9fcb5b2
No known key found for this signature in database GPG Key ID: 173E9B9CA92EEF8F
9 changed files with 18 additions and 19 deletions
  1. +1
    -1
      docs/api/api_python/mindrecord/mindspore.mindrecord.Cifar100ToMR.rst
  2. +1
    -1
      docs/api/api_python/mindrecord/mindspore.mindrecord.Cifar10ToMR.rst
  3. +1
    -1
      docs/api/api_python/mindrecord/mindspore.mindrecord.CsvToMR.rst
  4. +5
    -5
      docs/api/api_python/mindrecord/mindspore.mindrecord.FileReader.rst
  5. +1
    -1
      docs/api/api_python/mindrecord/mindspore.mindrecord.ImageNetToMR.rst
  6. +1
    -1
      docs/api/api_python/mindrecord/mindspore.mindrecord.MnistToMR.rst
  7. +3
    -3
      docs/api/api_python/mindrecord/mindspore.mindrecord.TFRecordToMR.rst
  8. +3
    -3
      mindspore/python/mindspore/mindrecord/filereader.py
  9. +2
    -3
      mindspore/python/mindspore/mindrecord/tools/tfrecord_to_mr.py

+ 1
- 1
docs/api/api_python/mindrecord/mindspore.mindrecord.Cifar100ToMR.rst View File

@@ -1,7 +1,7 @@

.. py:class:: mindspore.mindrecord.Cifar100ToMR(source, destination)

将CIFAR-100数据集转换为MindRecord格式数据集的类
将CIFAR-100数据集转换为MindRecord格式数据集。

.. note::
示例的详细信息,请参见 `转换CIFAR-10数据集 <https://mindspore.cn/docs/programming_guide/zh-CN/master/dataset_conversion.html#转换CIFAR-10数据集>`_。


+ 1
- 1
docs/api/api_python/mindrecord/mindspore.mindrecord.Cifar10ToMR.rst View File

@@ -1,7 +1,7 @@

.. py:class:: mindspore.mindrecord.Cifar10ToMR(source, destination)

将CIFAR-10数据集转换为MindRecord格式数据集的类
将CIFAR-10数据集转换为MindRecord格式数据集。

.. note::
示例的详细信息,请参见 `转换CIFAR-10数据集 <https://mindspore.cn/docs/programming_guide/zh-CN/master/dataset_conversion.html#转换CIFAR-10数据集>`_。


+ 1
- 1
docs/api/api_python/mindrecord/mindspore.mindrecord.CsvToMR.rst View File

@@ -1,7 +1,7 @@

.. py:class:: mindspore.mindrecord.CsvToMR(source, destination, columns_list=None, partition_number=1)

将CSV格式数据集转换为MindRecord格式数据集的类
将CSV格式数据集转换为MindRecord格式数据集。

.. note::
示例的详细信息,请参见 `转换CSV数据集 <https://mindspore.cn/docs/programming_guide/zh-CN/master/dataset_conversion.html#转换CSV数据集>`_。


+ 5
- 5
docs/api/api_python/mindrecord/mindspore.mindrecord.FileReader.rst View File

@@ -1,15 +1,15 @@

.. py:class:: mindspore.mindrecord.FileReader(file_name, num_consumer=4, columns=None, operator=None)

读取MindRecord格式数据集的类
读取MindRecord格式数据集。

.. note::
- 如果 `file_name` 是文件的字符串,则会尝试加载同一批转换生成的所有MindRecord文件,如果缺少其中某个MindRecord文件,则会引发异常。
- 如果 `file_name` 是文件的列表,则只加载列表中指定的MindRecord文件。
- 如果 `file_name` 是文件路径的字符串,则会尝试加载同一批转换生成的所有MindRecord文件,如果缺少其中某个MindRecord文件,则会引发异常。
- 如果 `file_name` 是文件路径组成的列表,则只加载列表中指定的MindRecord文件。

**参数:**

- **file_name** (str, list[str]) - MindRecord格式的数据集文件或文件列表。
- **file_name** (str, list[str]) - MindRecord格式的数据集文件路径或文件路径组成的列表。
- **num_consumer** (int,可选) - 加载数据的并发数。默认值:4。不应小于1或大于处理器的核数。
- **columns** (list[str],可选) - MindRecord中待读取数据列的列表。默认值:None,读取所有的数据列。
- **operator** (int,可选) - 保留参数。默认值:None。
@@ -26,7 +26,7 @@

.. py:method:: get_next()

按列名一次返回一个batch的数据。
按列名一次返回下一批的数据。

**返回:**



+ 1
- 1
docs/api/api_python/mindrecord/mindspore.mindrecord.ImageNetToMR.rst View File

@@ -1,7 +1,7 @@

.. py:class:: mindspore.mindrecord.ImageNetToMR(map_file, image_dir, destination, partition_number=1)

将ImageNet数据集转换为MindRecord格式数据集的类
将ImageNet数据集转换为MindRecord格式数据集。

.. note::
示例的详细信息,请参见 `Converting the ImageNet Dataset <https:// www.mindspore.cn/docs/programming_guide/en/master/dataset_conversion.html#converting-the-imagenet-dataset>`_。


+ 1
- 1
docs/api/api_python/mindrecord/mindspore.mindrecord.MnistToMR.rst View File

@@ -1,7 +1,7 @@

.. py:class:: mindspore.mindrecord.MnistToMR(source, destination, partition_number=1)

将MNIST数据集转换为MindRecord格式数据集的类
将MNIST数据集转换为MindRecord格式数据集。

**参数:**



+ 3
- 3
docs/api/api_python/mindrecord/mindspore.mindrecord.TFRecordToMR.rst View File

@@ -1,7 +1,7 @@

.. py:class:: mindspore.mindrecord.TFRecordToMR(source, destination, feature_dict, bytes_fields=None)

将TFRecord格式数据集转换为MindRecord格式数据集的类
将TFRecord格式数据集转换为MindRecord格式数据集。

.. note::
示例的详细信息,请参见 `转换TFRecord数据集 <https://mindspore.cn/docs/programming_guide/zh-CN/master/dataset_conversion.html#转换TFRecord数据集>`_。
@@ -10,8 +10,8 @@

- **source** (str) - 待转换的TFRecord文件路径。
- **destination** (str) - 转换生成的MindRecord文件路径,需提前创建目录并且目录下不能存在同名文件。
- **feature_dict** (dict[str, `FixedLenFeature <https://www.tensorflow.org/api_docs/python/tf/io/FixedLenFeature>`_ ]) - TFRecord的feature类别的字典,
不支持 `VarLenFeature <https://www.tensorflow.org/api_docs/python/tf/io/VarLenFeature>`_ 类别
- **feature_dict** (dict[str, FixedLenFeature]) - TFRecord的feature类别的字典,当前支持
`FixedLenFeature <https://www.tensorflow.org/api_docs/python/tf/io/FixedLenFeature>`_ 类型
- **bytes_fields** (list[str],可选) - `feature_dict` 中的字节字段,可以为字节类型的图像字段。

**异常:**


+ 3
- 3
mindspore/python/mindspore/mindrecord/filereader.py View File

@@ -31,12 +31,12 @@ class FileReader:
Class to read MindRecord files.

Note:
If `file_name` is a filename string, it tries to load all MindRecord files generated \
If `file_name` is a file path, it tries to load all MindRecord files generated \
in a conversion, and throws an exception if a MindRecord file is missing.
If `file_name` is a filename list, only the MindRecord files in the list are loaded.
If `file_name` is file path list, only the MindRecord files in the list are loaded.

Args:
file_name (str, list[str]): One of MindRecord file or a file list.
file_name (str, list[str]): One of MindRecord file path or file path list.
num_consumer(int, optional): Number of reader workers which load data. Default: 4.
It should not be smaller than 1 or larger than the number of processor cores.
columns (list[str], optional): A list of fields where corresponding data would be read. Default: None.


+ 2
- 3
mindspore/python/mindspore/mindrecord/tools/tfrecord_to_mr.py View File

@@ -75,9 +75,8 @@ class TFRecordToMR:
source (str): TFRecord file to be transformed.
destination (str): MindRecord file path to transform into, ensure that no file with the same name
exists in the directory.
feature_dict (dict[str, `FixedLenFeature <https://www.tensorflow.org/api_docs/python/tf/io/FixedLenFeature>`_]): Dictionary
that states the feature type, and `VarLenFeature <https://www.tensorflow.org/api_docs/python/tf/io/VarLenFeature>`_
is not supported.
feature_dict (dict[str, FixedLenFeature]): Dictionary that states the feature type, and
`FixedLenFeature <https://www.tensorflow.org/api_docs/python/tf/io/FixedLenFeature>`_ is supported.
bytes_fields (list[str], optional): The bytes fields which are in `feature_dict` and can be images bytes.
Default: None.



Loading…
Cancel
Save