Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
T
tic
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wenyuanbo
tic
Commits
543c4240
Unverified
Commit
543c4240
authored
Sep 19, 2018
by
Tianqi Chen
Committed by
GitHub
Sep 19, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[NNVM] Recover reduction behavir, fix CI (#1740)
parent
ac7b4205
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
0 deletions
+18
-0
nnvm/src/top/tensor/reduce.cc
+5
-0
topi/include/topi/reduction.h
+11
-0
topi/src/topi.cc
+2
-0
No files found.
nnvm/src/top/tensor/reduce.cc
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
;
...
...
topi/include/topi/reduction.h
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
;
}
...
...
topi/src/topi.cc
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>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment