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
d6f3bf16
Commit
d6f3bf16
authored
Aug 01, 2018
by
abergeron
Committed by
Tianqi Chen
Aug 01, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add some missing operators (#1524)
parent
82e59385
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
32 additions
and
0 deletions
+32
-0
nnvm/python/nnvm/top/tensor.py
+8
-0
nnvm/src/top/tensor/elemwise.cc
+24
-0
No files found.
nnvm/python/nnvm/top/tensor.py
View file @
d6f3bf16
...
...
@@ -156,6 +156,14 @@ reg.register_schedule("elemwise_mul", _fschedule_broadcast)
reg
.
register_pattern
(
"elemwise_div"
,
OpPattern
.
BROADCAST
)
reg
.
register_schedule
(
"elemwise_div"
,
_fschedule_broadcast
)
# elemwise_mod
reg
.
register_pattern
(
"elemwise_mod"
,
OpPattern
.
BROADCAST
)
reg
.
register_schedule
(
"elemwise_mod"
,
_fschedule_broadcast
)
# elemwise_pow
reg
.
register_pattern
(
"elemwise_pow"
,
OpPattern
.
BROADCAST
)
reg
.
register_schedule
(
"elemwise_pow"
,
_fschedule_broadcast
)
# broadcast_add
reg
.
register_pattern
(
"broadcast_add"
,
OpPattern
.
BROADCAST
)
reg
.
register_schedule
(
"broadcast_add"
,
_fschedule_broadcast
)
...
...
nnvm/src/top/tensor/elemwise.cc
View file @
d6f3bf16
...
...
@@ -337,6 +337,30 @@ NNVM_REGISTER_ELEMWISE_BINARY_OP(elemwise_div)
};
});
NNVM_REGISTER_ELEMWISE_BINARY_OP
(
elemwise_mod
)
.
describe
(
R"code(Element-wise modulo
)code"
NNVM_ADD_FILELINE
)
.
set_support_level
(
1
)
.
set_attr
<
FTVMCompute
>
(
"FTVMCompute"
,
[](
const
NodeAttrs
&
attrs
,
const
Array
<
Tensor
>&
inputs
,
const
Array
<
Tensor
>&
out_info
)
{
return
Array
<
Tensor
>
{
topi
::
mod
(
inputs
[
0
],
inputs
[
1
])
};
});
NNVM_REGISTER_ELEMWISE_BINARY_OP
(
elemwise_pow
)
.
describe
(
R"code(Element-wise power
)code"
NNVM_ADD_FILELINE
)
.
set_support_level
(
1
)
.
set_attr
<
FTVMCompute
>
(
"FTVMCompute"
,
[](
const
NodeAttrs
&
attrs
,
const
Array
<
Tensor
>&
inputs
,
const
Array
<
Tensor
>&
out_info
)
{
return
Array
<
Tensor
>
{
topi
::
power
(
inputs
[
0
],
inputs
[
1
])
};
});
// negative
NNVM_REGISTER_ELEMWISE_UNARY_OP
(
negative
)
.
describe
(
R"code(Elemenwise numeric negative
...
...
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