浏览代码

fix: api comment format

tags/v0.5.0-beta
jonyguo 5 年前
父节点
当前提交
b73b360e22
共有 1 个文件被更改,包括 10 次插入10 次删除
  1. +10
    -10
      mindspore/mindrecord/tools/tfrecord_to_mr.py

+ 10
- 10
mindspore/mindrecord/tools/tfrecord_to_mr.py 查看文件

@@ -105,21 +105,21 @@ class TFRecordToMR:
source (str): the TFRecord file to be transformed.
destination (str): the MindRecord file path to tranform into.
feature_dict (dict): a dictionary than states the feature type, i.e.
feature_dict = {"xxxx": tf.io.FixedLenFeature([], tf.string),
feature_dict = {"xxxx": tf.io.FixedLenFeature([], tf.string), \
"yyyy": tf.io.FixedLenFeature([], tf.int64)}
****** follow case which uses VarLenFeature not support ******
feature_dict = {"context": {"xxxx": tf.io.FixedLenFeature([], tf.string),
"yyyy": tf.io.VarLenFeature(tf.int64)},

**Follow case which uses VarLenFeature not support**

feature_dict = {"context": {"xxxx": tf.io.FixedLenFeature([], tf.string), \
"yyyy": tf.io.VarLenFeature(tf.int64)}, \
"sequence": {"zzzz": tf.io.FixedLenSequenceFeature([], tf.float32)}}
bytes_fields (list): the bytes fields which are in feature_dict.

Rasies:
ValueError, when:
1) parameter TFRecord is not string.
2) parameter MindRecord is not string.
3) feature_dict is not FixedLenFeature.
4) parameter bytes_field is not list(str) or not in feature_dict
Exception, when tensorflow module not found or version is not correct.
ValueError: the following condition will cause ValueError, 1) parameter TFRecord is not string, 2) parameter
MindRecord is not string, 3) feature_dict is not FixedLenFeature, 4) parameter bytes_field is not list(str)
or not in feature_dict.
Exception: when tensorflow module not found or version is not correct.
"""
def __init__(self, source, destination, feature_dict, bytes_fields=None):
if not tf:


正在加载...
取消
保存