-
Notifications
You must be signed in to change notification settings - Fork 82
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
[Tensor] Zero point support for unsigned int type #2940
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.
Nice work. LGTM!
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.
Overall looks good ! Please check the type of pointer:
nntrainer/tensor/uint_tensor.cpp
Outdated
// copy scale factors | ||
float *scales = (float *)(((int16_t *)buf) + size()); | ||
scopy(scale_size(), scales, 1, (float *)getScale(), 1); | ||
|
||
// copy zero points | ||
unsigned int *zps = | ||
(unsigned int *)((float *)(((int16_t *)buf) + size()) + scale_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.
// copy scale factors | |
float *scales = (float *)(((int16_t *)buf) + size()); | |
scopy(scale_size(), scales, 1, (float *)getScale(), 1); | |
// copy zero points | |
unsigned int *zps = | |
(unsigned int *)((float *)(((int16_t *)buf) + size()) + scale_size()); | |
// copy scale factors | |
float *scales = (float *)(((T *)buf) + size()); | |
scopy(scale_size(), scales, 1, (float *)getScale(), 1); | |
// copy zero points | |
unsigned int *zps = | |
(unsigned int *)((float *)(((T *)buf) + size()) + scale_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.
Thank you! You are the best 👍
This pull request updates the unsigned int type Tensor class to include zero points in its memory management. It's important to note that the size of the scale factors matches the size of the zero points. At present, the zero point uses a scale factor size, which will be modified soon. **Self-evaluation:** 1. Build test: [X]Passed [ ]Failed [ ]Skipped 2. Run test: [X]Passed [ ]Failed [ ]Skipped Signed-off-by: Donghyeon Jeong <[email protected]>
5783b38
to
e4a1725
Compare
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.
Nice work!
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 ! 👍
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 pull request updates the unsigned int type Tensor class to include zero points in its memory management.
It's important to note that the size of the scale factors matches the size of the zero points.
At present, the zero point uses a scale factor size, which will be modified soon.
Self-evaluation: