@@ -23,13 +23,12 @@ namespace reader {
23
23
class CustomReader : public framework ::DecoratedReader {
24
24
public:
25
25
CustomReader (ReaderBase* reader, const framework::BlockDesc& sub_block,
26
- const platform::Place& dev_place,
27
26
const std::vector<std::string>& source_var_names,
28
27
const std::vector<std::string>& sink_var_names)
29
28
: DecoratedReader(reader),
30
29
program_ (*sub_block.Program()),
31
30
sub_block_id_(sub_block.ID()),
32
- exe_(framework::Executor(dev_place )),
31
+ exe_(framework::Executor(platform::CPUPlace() )),
33
32
source_var_names_(source_var_names),
34
33
sink_var_names_(sink_var_names) {}
35
34
@@ -60,7 +59,7 @@ class CreateCustomReaderOp : public framework::OperatorBase {
60
59
const auto & underlying_reader = scope.FindVar (Input (" UnderlyingReader" ))
61
60
->Get <framework::ReaderHolder>();
62
61
out->Reset (
63
- new CustomReader (underlying_reader.Get (), *sub_block, dev_place,
62
+ new CustomReader (underlying_reader.Get (), *sub_block,
64
63
Attr<std::vector<std::string>>(" source_var_names" ),
65
64
Attr<std::vector<std::string>>(" sink_var_names" )));
66
65
}
@@ -85,9 +84,10 @@ class CreateCustomReaderOpMaker : public DecoratedReaderMakerBase {
85
84
CreateCustomReader Operator
86
85
87
86
A custom reader can be used for input data preprocessing.
88
- A custom reader holds its own sub-block, which will be executed in its
89
- 'ReadNext()' function. Users can configurate their own preprocessing
90
- pipelines by inserting operators into custom reader's sub-block.
87
+ A custom reader holds its own sub-block, which will be executed in CPU
88
+ in its 'ReadNext()' function. Users can configurate their own
89
+ preprocessing pipelines by inserting operators into custom reader's
90
+ sub-block.
91
91
)DOC" );
92
92
}
93
93
};
0 commit comments