-
Notifications
You must be signed in to change notification settings - Fork 7.2k
Replaced CHECK_ by TORCH_CHECK_ #6322
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -50,7 +50,7 @@ void gotFilesStats(std::vector<VideoFileStats>& stats) { | |
fseek(f, 0, SEEK_END); | ||
std::vector<uint8_t> buffer(ftell(f)); | ||
rewind(f); | ||
CHECK_EQ(buffer.size(), fread(buffer.data(), 1, buffer.size(), f)); | ||
TORCH_CHECK_EQ(buffer.size(), fread(buffer.data(), 1, buffer.size(), f)); | ||
fclose(f); | ||
|
||
for (size_t i = 0; i < rounds; ++i) { | ||
|
@@ -66,7 +66,7 @@ void gotFilesStats(std::vector<VideoFileStats>& stats) { | |
avgProvUs += | ||
std::chrono::duration_cast<std::chrono::microseconds>(then - now) | ||
.count(); | ||
CHECK_EQ(metadata.size(), 1); | ||
TORCH_CHECK_EQ(metadata.size(), 1); | ||
item.num = metadata[0].num; | ||
item.den = metadata[0].den; | ||
item.fps = metadata[0].fps; | ||
|
@@ -90,7 +90,7 @@ size_t measurePerformanceUs( | |
fseek(f, 0, SEEK_END); | ||
std::vector<uint8_t> buffer(ftell(f)); | ||
rewind(f); | ||
CHECK_EQ(buffer.size(), fread(buffer.data(), 1, buffer.size(), f)); | ||
TORCH_CHECK_EQ(buffer.size(), fread(buffer.data(), 1, buffer.size(), f)); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. another one |
||
fclose(f); | ||
|
||
for (size_t i = 0; i < rounds; ++i) { | ||
|
@@ -324,7 +324,7 @@ TEST(SyncDecoder, TestMemoryBuffer) { | |
fseek(f, 0, SEEK_END); | ||
std::vector<uint8_t> buffer(ftell(f)); | ||
rewind(f); | ||
CHECK_EQ(buffer.size(), fread(buffer.data(), 1, buffer.size(), f)); | ||
TORCH_CHECK_EQ(buffer.size(), fread(buffer.data(), 1, buffer.size(), f)); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this one too |
||
fclose(f); | ||
CHECK(decoder.init( | ||
params, | ||
|
@@ -349,7 +349,7 @@ TEST(SyncDecoder, TestMemoryBufferNoSeekableWithFullRead) { | |
fseek(f, 0, SEEK_END); | ||
std::vector<uint8_t> buffer(ftell(f)); | ||
rewind(f); | ||
CHECK_EQ(buffer.size(), fread(buffer.data(), 1, buffer.size(), f)); | ||
TORCH_CHECK_EQ(buffer.size(), fread(buffer.data(), 1, buffer.size(), f)); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this one too |
||
fclose(f); | ||
|
||
params.maxSeekableBytes = buffer.size() + 1; | ||
|
@@ -388,7 +388,7 @@ TEST(SyncDecoder, TestMemoryBufferNoSeekableWithPartialRead) { | |
fseek(f, 0, SEEK_END); | ||
std::vector<uint8_t> buffer(ftell(f)); | ||
rewind(f); | ||
CHECK_EQ(buffer.size(), fread(buffer.data(), 1, buffer.size(), f)); | ||
TORCH_CHECK_EQ(buffer.size(), fread(buffer.data(), 1, buffer.size(), f)); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this one too |
||
fclose(f); | ||
|
||
params.maxSeekableBytes = buffer.size() / 2; | ||
|
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not just a check. This is a function call that must be performed and then checked for its output. Unfortunately the new TORCH_CHECK_EQ mechanism can skip completely the method call if not in debug mode. This means that the function call will never be done causing issues.