[QNN] Concat - Refactoring to C++#3819
Merged
zhiics merged 1 commit intoapache:masterfrom Aug 31, 2019
Merged
Conversation
41c82e4 to
6b35322
Compare
ea98355 to
5679038
Compare
Contributor
Author
|
@vinx13 @zhiics @yzhliu Can you please review this? Refactoring to C++ removes InferType dependency. Relevant comment - #3730 (comment) |
vinx13
requested changes
Aug 30, 2019
src/relay/pass/pattern_util.h
Outdated
| return CallNode::make(op, {fill_value}, Attrs(attrs), {}); | ||
| } | ||
|
|
||
| static inline Expr Concatenate(Expr data, int axis) { |
Member
There was a problem hiding this comment.
this is actually the same as MakeConcatenate below isn't it?
Contributor
Author
There was a problem hiding this comment.
Yup. Nice observation. Made the changes to use that.
5679038 to
b1e43d2
Compare
zhiics
requested changes
Aug 30, 2019
src/relay/qnn/op/concatenate.cc
Outdated
| Array<tvm::Expr> input_zero_points, double output_scale, | ||
| int32_t output_zero_point, int axis) { | ||
| auto attrs = make_node<QnnConcatenateAttrs>(); | ||
| attrs->input_scales = input_scales; |
Member
There was a problem hiding this comment.
Suggested change
| attrs->input_scales = input_scales; | |
| attrs->input_scales = std::move(input_scales); |
src/relay/qnn/op/concatenate.cc
Outdated
| int32_t output_zero_point, int axis) { | ||
| auto attrs = make_node<QnnConcatenateAttrs>(); | ||
| attrs->input_scales = input_scales; | ||
| attrs->input_zero_points = input_zero_points; |
Member
There was a problem hiding this comment.
Suggested change
| attrs->input_zero_points = input_zero_points; | |
| attrs->input_zero_points = std::move(input_zero_points); |
src/relay/qnn/op/concatenate.cc
Outdated
|
|
||
| /* | ||
| * \brief Canonicalizes the QNN concatenate op. | ||
| * \param ref_call The original call that will be lowered. |
Member
There was a problem hiding this comment.
Names in comment mismatch with the arguments.
src/relay/qnn/util.h
Outdated
| const Array<IndexExpr>& input_shape, const DataType& out_dtype); | ||
|
|
||
| static inline Expr Requantize(const Expr& data, const Array<IndexExpr>& input_shape, | ||
| const double& input_scale, const int32_t& input_zero_point, |
Member
There was a problem hiding this comment.
no need to have const xx& for built-in types, just double input_scale, int32_t input_zero_point etc.
b1e43d2 to
cc55ce8
Compare
Contributor
Author
vinx13
approved these changes
Aug 31, 2019
Merged
wweic
pushed a commit
to wweic/tvm
that referenced
this pull request
Sep 16, 2019
wweic
pushed a commit
to wweic/tvm
that referenced
this pull request
Sep 16, 2019
wweic
pushed a commit
to neo-ai/tvm
that referenced
this pull request
Sep 16, 2019
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.
There are 2 reasons for moving to C++
Please review @yzhliu @jackwish @FrozenGene @vinx13 @tqchen @zhiics