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
d50f7b66
Commit
d50f7b66
authored
Dec 07, 2018
by
Sergey Mironov
Committed by
Tianqi Chen
Dec 07, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix missing sigmoid intrinsic in C++ (#2231)
parent
94b309a1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
3 deletions
+10
-3
python/tvm/intrin.py
+0
-3
src/codegen/intrin_rule.cc
+10
-0
No files found.
python/tvm/intrin.py
View file @
d50f7b66
...
...
@@ -492,6 +492,3 @@ def _rule_float_direct(op):
register_intrin_rule
(
"opencl"
,
"exp"
,
_rule_float_direct
,
override
=
True
)
# default pattern for exp
register_intrin_rule
(
"default"
,
"exp"
,
_rule_float_suffix
,
override
=
True
)
# default pattern for sigmoid
register_intrin_rule
(
"default"
,
"sigmoid"
,
lambda
op
:
1.0
/
(
1.0
+
exp
(
-
op
.
args
[
0
])))
src/codegen/intrin_rule.cc
View file @
d50f7b66
...
...
@@ -24,6 +24,16 @@ TVM_REGISTER_GLOBAL("tvm.intrin.rule.default.sqrt")
TVM_REGISTER_GLOBAL
(
"tvm.intrin.rule.default.pow"
)
.
set_body
(
DispatchExtern
<
FloatSuffix
>
);
TVM_REGISTER_GLOBAL
(
"tvm.intrin.rule.default.sigmoid"
)
.
set_body
([](
const
TVMArgs
&
args
,
TVMRetValue
*
rv
){
Expr
e
=
args
[
0
];
const
Call
*
call
=
e
.
as
<
Call
>
();
CHECK
(
call
!=
nullptr
);
auto
one
=
make_const
(
call
->
args
[
0
].
type
(),
1
);
*
rv
=
one
/
(
one
+
exp
(
-
call
->
args
[
0
]));
});
}
// namespace intrin
}
// namespace codegen
}
// namespace tvm
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