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
c3306dd8
Commit
c3306dd8
authored
Jan 12, 2017
by
Bing Xu
Committed by
Tianqi Chen
May 29, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix mxnet amalgamation (#96)
parent
532ed620
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
24 deletions
+24
-24
nnvm/include/nnvm/tuple.h
+24
-24
No files found.
nnvm/include/nnvm/tuple.h
View file @
c3306dd8
...
...
@@ -275,6 +275,30 @@ class Tuple {
t
.
assign
(
tmp
.
begin
(),
tmp
.
end
());
return
is
;
}
/*!
* \brief save the content into binary stream
* \param strm the output stream
* \tparam TStream any stream type that have write
*/
template
<
typename
TStream
>
inline
void
Save
(
TStream
*
strm
)
const
{
strm
->
Write
(
&
ndim_
,
sizeof
(
ndim_
));
strm
->
Write
(
begin
(),
sizeof
(
ValueType
)
*
ndim_
);
}
/*!
* \brief load the content from binary stream
* \param strm the output stream
* \tparam TStream any stream type that have write
* \return whether the load is successful
*/
template
<
typename
TStream
>
inline
bool
Load
(
TStream
*
strm
)
{
if
(
strm
->
Read
(
&
ndim_
,
sizeof
(
ndim_
))
!=
sizeof
(
ndim_
))
return
false
;
this
->
SetDim
(
ndim_
);
size_t
nread
=
sizeof
(
ValueType
)
*
ndim_
;
if
(
strm
->
Read
(
begin
(),
nread
)
!=
nread
)
return
false
;
return
true
;
}
protected
:
// stack cache size
...
...
@@ -511,30 +535,6 @@ class TShape : public Tuple<index_t> {
inline
bool
operator
!=
(
const
mshadow
::
Shape
<
dim
>
&
s
)
const
{
return
!
(
*
this
==
s
);
}
/*!
* \brief save the content into binary stream
* \param strm the output stream
* \tparam TStream any stream type that have write
*/
template
<
typename
TStream
>
inline
void
Save
(
TStream
*
strm
)
const
{
strm
->
Write
(
&
ndim_
,
sizeof
(
ndim_
));
strm
->
Write
(
data
(),
sizeof
(
index_t
)
*
ndim_
);
}
/*!
* \brief load the content from binary stream
* \param strm the output stream
* \tparam TStream any stream type that have write
* \return whether the load is successful
*/
template
<
typename
TStream
>
inline
bool
Load
(
TStream
*
strm
)
{
if
(
strm
->
Read
(
&
ndim_
,
sizeof
(
ndim_
))
!=
sizeof
(
ndim_
))
return
false
;
this
->
SetDim
(
ndim_
);
size_t
nread
=
sizeof
(
index_t
)
*
ndim_
;
if
(
strm
->
Read
(
data
(),
nread
)
!=
nread
)
return
false
;
return
true
;
}
#endif
};
...
...
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