You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tvm.apache.org by ma...@apache.org on 2022/06/10 10:54:36 UTC
[tvm] branch main updated: [Bugfix] GetReduceAxes accept empty axis (#11643)
This is an automated email from the ASF dual-hosted git repository.
masahi pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/tvm.git
The following commit(s) were added to refs/heads/main by this push:
new 8a2f43eb0d [Bugfix] GetReduceAxes accept empty axis (#11643)
8a2f43eb0d is described below
commit 8a2f43eb0dd1eeaecaa1275a75aa35d4051386d5
Author: yuanfz <42...@users.noreply.github.com>
AuthorDate: Fri Jun 10 12:54:31 2022 +0200
[Bugfix] GetReduceAxes accept empty axis (#11643)
* emptycommit 2nd try
* code
Co-authored-by: yuanfz <42...@users.noreply.github.com>
---
src/relay/op/tensor/reduce.cc | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/relay/op/tensor/reduce.cc b/src/relay/op/tensor/reduce.cc
index d844bb57f3..fba2a60cec 100644
--- a/src/relay/op/tensor/reduce.cc
+++ b/src/relay/op/tensor/reduce.cc
@@ -50,7 +50,7 @@ TVM_REGISTER_NODE_TYPE(VarianceAttrs);
*/
inline std::vector<int64_t> GetReduceAxes(const uint32_t indim, const Array<Integer>& inaxis,
bool exclude) {
- if (!inaxis.defined()) {
+ if (!inaxis.defined() || inaxis.empty()) {
std::vector<int64_t> r_axes(indim);
std::iota(r_axes.begin(), r_axes.end(), 0);
return r_axes;