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
03735b42
Commit
03735b42
authored
Oct 22, 2016
by
tqchen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Allow all enum int to be exposed
parent
bc3959b2
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
5 deletions
+12
-5
include/tvm/array.h
+1
-1
include/tvm/base.h
+9
-2
src/c_api/c_api.cc
+2
-2
No files found.
include/tvm/array.h
View file @
03735b42
...
@@ -31,7 +31,7 @@ class ArrayNode : public Node {
...
@@ -31,7 +31,7 @@ class ArrayNode : public Node {
};
};
/*!
/*!
* \brief
Immutable a
rray container of NodeRef in DSL graph.
* \brief
A
rray container of NodeRef in DSL graph.
* Array implements copy on write semantics, which means array is mutable
* Array implements copy on write semantics, which means array is mutable
* but copy will happen when array is referenced in more than two places.
* but copy will happen when array is referenced in more than two places.
* \tparam T The content NodeRef type.
* \tparam T The content NodeRef type.
...
...
include/tvm/base.h
View file @
03735b42
...
@@ -23,7 +23,7 @@ class UnaryOp;
...
@@ -23,7 +23,7 @@ class UnaryOp;
class
BinaryOp
;
class
BinaryOp
;
/*! \brief list of all supported data types */
/*! \brief list of all supported data types */
enum
DataType
{
enum
DataType
:
int
{
kUnknown
=
0
,
kUnknown
=
0
,
kInt32
=
1
,
kInt32
=
1
,
kFloat32
=
2
kFloat32
=
2
...
@@ -56,10 +56,17 @@ class AttrVisitor {
...
@@ -56,10 +56,17 @@ class AttrVisitor {
//! \cond Doxygen_Suppress
//! \cond Doxygen_Suppress
virtual
void
Visit
(
const
char
*
key
,
double
*
value
)
=
0
;
virtual
void
Visit
(
const
char
*
key
,
double
*
value
)
=
0
;
virtual
void
Visit
(
const
char
*
key
,
int64_t
*
value
)
=
0
;
virtual
void
Visit
(
const
char
*
key
,
int64_t
*
value
)
=
0
;
virtual
void
Visit
(
const
char
*
key
,
DataType
*
value
)
=
0
;
virtual
void
Visit
(
const
char
*
key
,
int
*
value
)
=
0
;
virtual
void
Visit
(
const
char
*
key
,
std
::
string
*
value
)
=
0
;
virtual
void
Visit
(
const
char
*
key
,
std
::
string
*
value
)
=
0
;
virtual
void
Visit
(
const
char
*
key
,
const
UnaryOp
**
value
)
=
0
;
virtual
void
Visit
(
const
char
*
key
,
const
UnaryOp
**
value
)
=
0
;
virtual
void
Visit
(
const
char
*
key
,
const
BinaryOp
**
value
)
=
0
;
virtual
void
Visit
(
const
char
*
key
,
const
BinaryOp
**
value
)
=
0
;
template
<
typename
ENum
,
typename
=
typename
std
::
enable_if
<
std
::
is_enum
<
ENum
>::
value
>::
type
>
void
Visit
(
const
char
*
key
,
ENum
*
ptr
)
{
static_assert
(
std
::
is_same
<
int
,
typename
std
::
underlying_type
<
ENum
>::
type
>::
value
,
"declare enum to be enum int to use visitor"
);
this
->
Visit
(
key
,
reinterpret_cast
<
int
*>
(
ptr
));
}
//! \endcond
//! \endcond
};
};
...
...
src/c_api/c_api.cc
View file @
03735b42
...
@@ -45,7 +45,7 @@ struct APIAttrGetter : public AttrVisitor {
...
@@ -45,7 +45,7 @@ struct APIAttrGetter : public AttrVisitor {
void
Visit
(
const
char
*
key
,
int64_t
*
value
)
override
{
void
Visit
(
const
char
*
key
,
int64_t
*
value
)
override
{
if
(
skey
==
key
)
*
ret
=
value
[
0
];
if
(
skey
==
key
)
*
ret
=
value
[
0
];
}
}
void
Visit
(
const
char
*
key
,
DataType
*
value
)
override
{
void
Visit
(
const
char
*
key
,
int
*
value
)
override
{
if
(
skey
==
key
)
*
ret
=
static_cast
<
int64_t
>
(
value
[
0
]);
if
(
skey
==
key
)
*
ret
=
static_cast
<
int64_t
>
(
value
[
0
]);
}
}
void
Visit
(
const
char
*
key
,
std
::
string
*
value
)
override
{
void
Visit
(
const
char
*
key
,
std
::
string
*
value
)
override
{
...
@@ -68,7 +68,7 @@ struct APIAttrDir : public AttrVisitor {
...
@@ -68,7 +68,7 @@ struct APIAttrDir : public AttrVisitor {
void
Visit
(
const
char
*
key
,
int64_t
*
value
)
override
{
void
Visit
(
const
char
*
key
,
int64_t
*
value
)
override
{
names
->
push_back
(
key
);
names
->
push_back
(
key
);
}
}
void
Visit
(
const
char
*
key
,
DataType
*
value
)
override
{
void
Visit
(
const
char
*
key
,
int
*
value
)
override
{
names
->
push_back
(
key
);
names
->
push_back
(
key
);
}
}
void
Visit
(
const
char
*
key
,
std
::
string
*
value
)
override
{
void
Visit
(
const
char
*
key
,
std
::
string
*
value
)
override
{
...
...
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