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
6b0157bf
Unverified
Commit
6b0157bf
authored
Feb 13, 2019
by
Tianqi Chen
Committed by
GitHub
Feb 13, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[RUNTIME] Enable NDArray type extension (#2598)
parent
c53dd102
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
14 deletions
+25
-14
include/tvm/runtime/ndarray.h
+25
-14
No files found.
include/tvm/runtime/ndarray.h
View file @
6b0157bf
...
...
@@ -21,7 +21,7 @@ namespace runtime {
class
NDArray
{
public
:
// internal container type
struct
Container
;
class
Container
;
/*! \brief default constructor */
NDArray
()
{}
/*!
...
...
@@ -173,7 +173,7 @@ class NDArray {
// internal namespace
struct
Internal
;
pr
ivate
:
pr
otected
:
/*! \brief Internal Data content */
Container
*
data_
{
nullptr
};
// enable internal functions
...
...
@@ -198,7 +198,7 @@ inline bool SaveDLTensor(dmlc::Stream* strm, const DLTensor* tensor);
*
* \note: do not use this function directly, use NDArray.
*/
struct
NDArray
::
Container
{
class
NDArray
::
Container
{
public
:
// NOTE: the first part of this structure is the same as
// DLManagedTensor, note that, however, the deleter
...
...
@@ -225,6 +225,28 @@ struct NDArray::Container {
* currently defined by the system.
*/
void
(
*
deleter
)(
Container
*
self
)
=
nullptr
;
protected
:
friend
class
NDArray
;
friend
class
RPCWrappedFunc
;
/*!
* \brief Type flag used to indicate subclass.
* Default value 0 means normal NDArray::Conatainer.
*
* We can extend a more specialized NDArray::Container
* and use the array_type_index_ to indicate
* the specific array subclass.
*/
uint32_t
array_type_index_
{
0
};
/*! \brief The internal reference counter */
std
::
atomic
<
int
>
ref_counter_
{
0
};
/*!
* \brief The shape container,
* can be used used for shape data.
*/
std
::
vector
<
int64_t
>
shape_
;
public
:
/*! \brief default constructor */
Container
()
{
dl_tensor
.
data
=
nullptr
;
...
...
@@ -246,17 +268,6 @@ struct NDArray::Container {
}
}
}
private
:
friend
class
NDArray
;
friend
class
RPCWrappedFunc
;
/*!
* \brief The shape container,
* can be used used for shape data.
*/
std
::
vector
<
int64_t
>
shape_
;
/*! \brief The internal array object */
std
::
atomic
<
int
>
ref_counter_
{
0
};
};
// implementations of inline functions
...
...
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