Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
tvm
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
cld
ml
tvm
Commits
543c4240
"README.md" did not exist on "87d19f4f2792a17257308d05d8add87252461a6b"
Unverified
Commit
543c4240
authored
6 years ago
by
Tianqi Chen
Committed by
GitHub
6 years ago
Browse files
Options
Downloads
Patches
Plain Diff
[NNVM] Recover reduction behavir, fix CI (#1740)
parent
ac7b4205
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
nnvm/src/top/tensor/reduce.cc
+5
-0
5 additions, 0 deletions
nnvm/src/top/tensor/reduce.cc
topi/include/topi/reduction.h
+11
-0
11 additions, 0 deletions
topi/include/topi/reduction.h
topi/src/topi.cc
+2
-0
2 additions, 0 deletions
topi/src/topi.cc
with
18 additions
and
0 deletions
nnvm/src/top/tensor/reduce.cc
+
5
−
0
View file @
543c4240
...
...
@@ -3,6 +3,9 @@
* \file reduce.cc
* \brief reduce operator.
*/
// Enforce TOPI to use old behavior that reduces to at least 1d
#define TOPI_REDUCE_ATLEAST1D 1
#include
<nnvm/op.h>
#include
<nnvm/node.h>
#include
<nnvm/op_attr_types.h>
...
...
@@ -17,6 +20,8 @@
#include
"topi/reduction.h"
#include
"topi/transform.h"
static_assert
(
TOPI_REDUCE_ATLEAST1D
,
"need to use legacy reduce behavior"
);
namespace
nnvm
{
namespace
top
{
using
namespace
tvm
;
...
...
This diff is collapsed.
Click to expand it.
topi/include/topi/reduction.h
+
11
−
0
View file @
543c4240
...
...
@@ -20,6 +20,14 @@
#include
"topi/detail/constant_utils.h"
#include
"tvm/tvm.h"
/*!
* \brief macro flag to enable some legacy behavior which requires
* reduction result to be at least 1d.
*/
#ifndef TOPI_REDUCE_ATLEAST1D
#define TOPI_REDUCE_ATLEAST1D 0
#endif
namespace
topi
{
using
namespace
tvm
;
...
...
@@ -96,6 +104,9 @@ inline Array<Expr> MakeReduceTargetShape(const std::vector<int>& real_axis,
}
}
}
if
(
target_shape
.
size
()
==
0
&&
TOPI_REDUCE_ATLEAST1D
)
{
target_shape
.
push_back
(
1
);
}
return
target_shape
;
}
...
...
This diff is collapsed.
Click to expand it.
topi/src/topi.cc
+
2
−
0
View file @
543c4240
...
...
@@ -3,6 +3,8 @@
* \brief Registration of TVM operators and schedules
* \file topi.cc
*/
#define TOPI_REDUCE_ATLEAST1D 0
#include
<tvm/runtime/packed_func.h>
#include
<tvm/runtime/module.h>
#include
<tvm/runtime/registry.h>
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment