-
Notifications
You must be signed in to change notification settings - Fork 157
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
[train] Modify maxPool2D in training #14166
Conversation
This commit change casting to static cast. ONE-DCO-1.0-Signed-off-by: JuYoung Lee [email protected]
from : #14149 (comment) |
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.
LGTM
assert(paddingTop < (1 << 8)); | ||
assert(paddingLeft < (1 << 8)); | ||
_op_params.padding_values.height = static_cast<uint8_t>(paddingTop); | ||
_op_params.padding_values.width = static_cast<uint8_t>(paddingLeft); |
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.
Ah? It looks like typecasting to int16_t
is necessary, not uint8_t
.
ONE/compute/cker/include/cker/Types.h
Lines 81 to 83 in c82f8cb
struct PoolParams | |
{ | |
PaddingValues padding_values{0, 0}; |
ONE/compute/cker/include/cker/Types.h
Lines 66 to 70 in c82f8cb
struct PaddingValues | |
{ | |
int16_t width; | |
int16_t height; | |
}; |
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.
Tthere is no problem since _op_param.padding_values
are filled with zero-extended value from positive numbers of equal range.
- These padding parameters are always positive number.
The positive number range ofThe positive number range of both are not equal. Sorry for the wrong information.int16_t
is equal to the range ofuint8_t
.
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.
Aha I got it! Thank you for explanation 👍
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 positive number range of int16_t is equal to the range of uint8_t.
@ragmani Sorry, But I have another question.
Does it mean that int16_t
and uint8_t
have a same max value?
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.
Sorry, it was the wrong information. They are not the same max value.
uint8_t
: max value is1 << 7 - 1
int16_t
: max value is1 << 15 - 1
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.
Could you please check which type is appropriate?
#14166 (comment)
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.
LGTM
This commit updates padding type to int16 ONE-DCO-1.0-Signed-off-by: JuYoung Lee [email protected]
@nnfw-bot test all |
This commit change casting to static cast.
ONE-DCO-1.0-Signed-off-by: JuYoung Lee [email protected]