Qualcomm AI Engine Direct - Support OneHot Op.#6339
Draft
weilhuan-qti wants to merge 1 commit intogoogle-ai-edge:mainfrom
Draft
Qualcomm AI Engine Direct - Support OneHot Op.#6339weilhuan-qti wants to merge 1 commit intogoogle-ai-edge:mainfrom
weilhuan-qti wants to merge 1 commit intogoogle-ai-edge:mainfrom
Conversation
9ba6ce0 to
6422aab
Compare
Comment on lines
+60
to
+68
| if (on_value_tensor.GetDataType() != off_value_tensor.GetDataType()) { | ||
| QNN_LOG_ERROR("On value and off value must have the same data type."); | ||
| return {}; | ||
| } | ||
|
|
||
| if (on_value_tensor.GetDataType() != output_tensor.GetDataType()) { | ||
| QNN_LOG_ERROR("OneHot output data type must match on/off value data type."); | ||
| return {}; | ||
| } |
Contributor
There was a problem hiding this comment.
NIT:
Can we merge these 2 checks? They are very similar.
Comment on lines
+53
to
+77
| if (!IsScalarStaticTensor(depth_tensor) || | ||
| !IsScalarStaticTensor(on_value_tensor) || | ||
| !IsScalarStaticTensor(off_value_tensor)) { | ||
| QNN_LOG_ERROR("Depth, on value, and off value must be static scalars."); | ||
| return {}; | ||
| } | ||
|
|
||
| if (on_value_tensor.GetDataType() != off_value_tensor.GetDataType()) { | ||
| QNN_LOG_ERROR("On value and off value must have the same data type."); | ||
| return {}; | ||
| } | ||
|
|
||
| if (on_value_tensor.GetDataType() != output_tensor.GetDataType()) { | ||
| QNN_LOG_ERROR("OneHot output data type must match on/off value data type."); | ||
| return {}; | ||
| } | ||
|
|
||
| if ((on_value_tensor.IsQuantU8() || on_value_tensor.IsQuantI8() || | ||
| on_value_tensor.IsQuantU16()) && | ||
| (!IsScaleOffsetQuantParam(on_value_tensor) || | ||
| !IsScaleOffsetQuantParam(off_value_tensor))) { | ||
| QNN_LOG_ERROR( | ||
| "OneHot quantized on/off values must use scale-offset quantization."); | ||
| return {}; | ||
| } |
Contributor
There was a problem hiding this comment.
Is it possible to leave these checks for QAIRT validator?
Contributor
Author
There was a problem hiding this comment.
It will simplify the later implementation if we check on/off data type and their shape. But for quantization parameter type, we can remove it.
6422aab to
0884f36
Compare
0884f36 to
807c558
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
TEST