Skip to content

Commit

Permalink
Merge pull request #9240 from JiayiFeng/fix_bug_in_recordio
Browse files Browse the repository at this point in the history
Fix a bug of RecordIO
  • Loading branch information
JiayiFeng authored Mar 21, 2018
2 parents 873cb9b + 0b2f1b3 commit e4bd63d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
4 changes: 2 additions & 2 deletions paddle/fluid/recordio/header.cc
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ Header::Header(uint32_t num, uint32_t sum, Compressor c, uint32_t cs)

bool Header::Parse(std::istream& is) {
uint32_t magic;
size_t read_size =
is.readsome(reinterpret_cast<char*>(&magic), sizeof(uint32_t));
is.read(reinterpret_cast<char*>(&magic), sizeof(uint32_t));
size_t read_size = is.gcount();
if (read_size < sizeof(uint32_t)) {
return false;
}
Expand Down
1 change: 1 addition & 0 deletions paddle/fluid/recordio/scanner.cc
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ Scanner::Scanner(const std::string &filename) {
}

void Scanner::Reset() {
stream_->clear();
stream_->seekg(0, std::ios::beg);
ParseNextChunk();
}
Expand Down

0 comments on commit e4bd63d

Please sign in to comment.