diff --git a/paddle/fluid/framework/reader.h b/paddle/fluid/framework/reader.h index 3a413941df964c8d9454fafc6030c377c10f9fb1..8d744b57ace0bd2c02c9e99326dd061882bbbc22 100644 --- a/paddle/fluid/framework/reader.h +++ b/paddle/fluid/framework/reader.h @@ -62,9 +62,9 @@ class FileReader : public ReaderBase { // making it easier to access different type reader in Variables. class ReaderHolder { public: - void Reset(ReaderBase* reader) { reader_.reset(reader); } + void Reset(ReaderBase* reader) { reader_ = reader; } - ReaderBase* Get() const { return reader_.get(); } + ReaderBase* Get() const { return reader_; } void ReadNext(std::vector* out) { PADDLE_ENFORCE_NOT_NULL(reader_); @@ -76,7 +76,7 @@ class ReaderHolder { } private: - std::unique_ptr reader_; + ReaderBase* reader_; }; } // namespace framework