-
Notifications
You must be signed in to change notification settings - Fork 2.7k
[Protopipe] Workaround for INT64 input type #31972
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
Conversation
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.
I can't see where you actually convert from int64 to int32. Neither can I see for the output where you convert from int32 to int64. Please do a test with a int64 model with int64 precision where you check that you get the same output for the same input as benchmark app or singleimagetest.
// workaround for I64 input type precision | ||
if (mat.elemSize() == sizeof(int32_t) && file_byte_size == mat_byte_size * 2) { | ||
std::size_t elem_size = mat.elemSize(); | ||
for (std::size_t i = 0; i < mat_byte_size; i += elem_size) { |
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.
I can't see where you actually convert from int64 to int32. Neither can I see for the output where you convert from int32 to int64. Please do a test with a int64 model with int64 precision where you check that you get the same output for the same input as benchmark app or singleimagetest.
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.
The conversion is made here, when reading from the file, it reads lower 4 bytes from each 8 byte value
ifs.read(mat.ptr<char>() + i, elem_size); ifs.seekg(elem_size, std::ios::cur);
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.
C++ has functions to make the conversion from int64 to int32 explicit. Also trucking the upper half is not a common way for a conversion. Still I don't see the reverse conversion when saving the output.
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.
Output for i64 was not implemented as it was not request. When requested we might implement also output precision for i64
Details:
Tickets: