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
050bc91b
Commit
050bc91b
authored
May 21, 2017
by
Yizhi Liu
Committed by
Tianqi Chen
May 20, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add tvm.select (#148)
parent
134c6ba3
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
0 deletions
+19
-0
python/tvm/_ffi/node_generic.py
+2
-0
python/tvm/api.py
+17
-0
No files found.
python/tvm/_ffi/node_generic.py
View file @
050bc91b
...
...
@@ -34,6 +34,8 @@ def convert_to_node(value):
"""
if
isinstance
(
value
,
_CLASS_NODE_BASE
):
return
value
elif
isinstance
(
value
,
bool
):
return
const
(
value
,
'uint1x1'
)
elif
isinstance
(
value
,
Number
):
return
const
(
value
)
elif
isinstance
(
value
,
string_types
):
...
...
python/tvm/api.py
View file @
050bc91b
...
...
@@ -463,6 +463,23 @@ def reduce_axis(dom, name="rv"):
"""
return
_IterVar
(
dom
,
name
,
2
)
def
select
(
cond
,
t
,
f
):
"""Construct a select branch
Parameters
----------
cond : Expr
The condition
t : Expr
The result expression if cond is true.
f : Expr
The result expression if cond is false.
Returns
-------
node : Node
The tvm.expr.Select node
"""
return
_make
.
Select
(
convert
(
cond
),
convert
(
t
),
convert
(
f
))
def
comm_reducer
(
fcombine
,
fidentity
,
name
=
"reduce"
):
"""Create a commutative reducer for reduction.
...
...
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