提交 0457f064 编写于 作者: F fengjiayi

add comments

上级 e4e9d362
...@@ -68,12 +68,25 @@ class CreateCustomReaderOp : public framework::OperatorBase { ...@@ -68,12 +68,25 @@ class CreateCustomReaderOp : public framework::OperatorBase {
class CreateCustomReaderOpMaker : public DecoratedReaderMakerBase { class CreateCustomReaderOpMaker : public DecoratedReaderMakerBase {
protected: protected:
void Apply() override { void Apply() override {
AddAttr<framework::BlockDesc*>("sub_block", ""); AddAttr<framework::BlockDesc*>(
AddAttr<std::vector<std::string>>("source_var_names", ""); "sub_block", "The block to hold all preprocessing operators.");
AddAttr<std::vector<std::string>>("sink_var_names", ""); AddAttr<std::vector<std::string>>(
"source_var_names",
"Source variables are starting points of data preprocessing. They hold "
"preprocessing's input tensors. Each source variable corresponds to "
"one of underlying reader's output datas.");
AddAttr<std::vector<std::string>>(
"sink_var_names",
"Sink variables are ending points of data preprocessing. They hold "
"preprocessing's output tensors. Each sink variable corresponds to "
"one of custom reader's output datas.");
AddComment(R"DOC( AddComment(R"DOC(
CreateCustomReader Operator CreateCustomReader Operator
A custom reader can be used for input data preprocessing.
A custom reader holds its own sub-block, which will be executed in its
'ReadNext()' function. Users can configurate their own preprocessing
pipelines by inserting operators into custom reader's sub-block.
)DOC"); )DOC");
} }
}; };
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册