Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
D
dlib
Project
Project
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
钟尚武
dlib
Commits
3f542861
Commit
3f542861
authored
Apr 08, 2016
by
Davis King
Browse files
Options
Browse Files
Download
Plain Diff
merged
parents
95182765
6afc9233
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
50 additions
and
0 deletions
+50
-0
trainer_abstract.h
dlib/dnn/trainer_abstract.h
+4
-0
matrix.h
dlib/matrix/matrix.h
+28
-0
matrix_data_layout.h
dlib/matrix/matrix_data_layout.h
+18
-0
No files found.
dlib/dnn/trainer_abstract.h
View file @
3f542861
...
...
@@ -34,6 +34,10 @@ namespace dlib
training data and it will output a new network instance that has hopefully
learned something useful from your training data.
If you are compiling with CUDA then this object will use the GPU that is
currently selected (i.e. the one indicated by cudaGetDevice()) when
dnn_trainer is constructed. It will continue to use that device even if
you later change it by a call to cudaSetDevice().
!*/
public
:
...
...
dlib/matrix/matrix.h
View file @
3f542861
...
...
@@ -1114,14 +1114,42 @@ namespace dlib
#ifdef DLIB_HAS_RVALUE_REFERENCES
matrix
(
matrix
&&
item
)
{
#ifdef MATLAB_MEX_FILE
// You can't move memory around when compiled in a matlab mex file and the
// different locations have different persistence settings.
if
(
data
.
_private_is_persistent
()
==
item
.
data
.
_private_is_persistent
())
{
swap
(
item
);
}
else
{
data
.
set_size
(
item
.
nr
(),
item
.
nc
());
matrix_assign
(
*
this
,
item
);
}
#else
swap
(
item
);
#endif
}
matrix
&
operator
=
(
matrix
&&
rhs
)
{
#ifdef MATLAB_MEX_FILE
// You can't move memory around when compiled in a matlab mex file and the
// different locations have different persistence settings.
if
(
data
.
_private_is_persistent
()
==
rhs
.
data
.
_private_is_persistent
())
{
swap
(
rhs
);
}
else
{
data
.
set_size
(
rhs
.
nr
(),
rhs
.
nc
());
matrix_assign
(
*
this
,
rhs
);
}
#else
swap
(
rhs
);
#endif
return
*
this
;
}
#endif
...
...
dlib/matrix/matrix_data_layout.h
View file @
3f542861
...
...
@@ -188,6 +188,7 @@ namespace dlib
void
_private_set_mxArray
(
mxArray
*
)
{
DLIB_CASSERT
(
false
,
"This function should never be called."
);
}
mxArray
*
_private_release_mxArray
(){
DLIB_CASSERT
(
false
,
"This function should never be called."
);
}
void
_private_mark_non_persistent
()
{
DLIB_CASSERT
(
false
,
"This function should never be called."
);
}
bool
_private_is_persistent
()
{
DLIB_CASSERT
(
false
,
"This function should never be called."
);
}
#endif
private
:
...
...
@@ -257,6 +258,7 @@ namespace dlib
void
_private_set_mxArray
(
mxArray
*
)
{
DLIB_CASSERT
(
false
,
"This function should never be called."
);
}
mxArray
*
_private_release_mxArray
(){
DLIB_CASSERT
(
false
,
"This function should never be called."
);
}
void
_private_mark_non_persistent
()
{
DLIB_CASSERT
(
false
,
"This function should never be called."
);
}
bool
_private_is_persistent
()
{
DLIB_CASSERT
(
false
,
"This function should never be called."
);
}
#endif
private
:
...
...
@@ -338,6 +340,7 @@ namespace dlib
void
_private_set_mxArray
(
mxArray
*
)
{
DLIB_CASSERT
(
false
,
"This function should never be called."
);
}
mxArray
*
_private_release_mxArray
(){
DLIB_CASSERT
(
false
,
"This function should never be called."
);
}
void
_private_mark_non_persistent
()
{
DLIB_CASSERT
(
false
,
"This function should never be called."
);
}
bool
_private_is_persistent
()
{
DLIB_CASSERT
(
false
,
"This function should never be called."
);
}
#endif
private
:
...
...
@@ -422,6 +425,7 @@ namespace dlib
void
_private_set_mxArray
(
mxArray
*
)
{
DLIB_CASSERT
(
false
,
"This function should never be called."
);
}
mxArray
*
_private_release_mxArray
(){
DLIB_CASSERT
(
false
,
"This function should never be called."
);
}
void
_private_mark_non_persistent
()
{
DLIB_CASSERT
(
false
,
"This function should never be called."
);
}
bool
_private_is_persistent
()
{
DLIB_CASSERT
(
false
,
"This function should never be called."
);
}
#endif
private
:
...
...
@@ -508,6 +512,7 @@ namespace dlib
void
_private_set_mxArray
(
mxArray
*
)
{
DLIB_CASSERT
(
false
,
"This function should never be called."
);
}
mxArray
*
_private_release_mxArray
(){
DLIB_CASSERT
(
false
,
"This function should never be called."
);
}
void
_private_mark_non_persistent
()
{
DLIB_CASSERT
(
false
,
"This function should never be called."
);
}
bool
_private_is_persistent
()
{
DLIB_CASSERT
(
false
,
"This function should never be called."
);
}
#endif
private
:
T
*
data
;
...
...
@@ -630,6 +635,7 @@ namespace dlib
void
_private_set_mxArray
(
mxArray
*
)
{
DLIB_CASSERT
(
false
,
"This function should never be called."
);
}
mxArray
*
_private_release_mxArray
(){
DLIB_CASSERT
(
false
,
"This function should never be called."
);
}
void
_private_mark_non_persistent
()
{
DLIB_CASSERT
(
false
,
"This function should never be called."
);
}
bool
_private_is_persistent
()
{
DLIB_CASSERT
(
false
,
"This function should never be called."
);
}
#endif
private
:
...
...
@@ -699,6 +705,7 @@ namespace dlib
void
_private_set_mxArray
(
mxArray
*
)
{
DLIB_CASSERT
(
false
,
"This function should never be called."
);
}
mxArray
*
_private_release_mxArray
(){
DLIB_CASSERT
(
false
,
"This function should never be called."
);
}
void
_private_mark_non_persistent
()
{
DLIB_CASSERT
(
false
,
"This function should never be called."
);
}
bool
_private_is_persistent
()
{
DLIB_CASSERT
(
false
,
"This function should never be called."
);
}
#endif
private
:
...
...
@@ -780,6 +787,7 @@ namespace dlib
void
_private_set_mxArray
(
mxArray
*
)
{
DLIB_CASSERT
(
false
,
"This function should never be called."
);
}
mxArray
*
_private_release_mxArray
(){
DLIB_CASSERT
(
false
,
"This function should never be called."
);
}
void
_private_mark_non_persistent
()
{
DLIB_CASSERT
(
false
,
"This function should never be called."
);
}
bool
_private_is_persistent
()
{
DLIB_CASSERT
(
false
,
"This function should never be called."
);
}
#endif
private
:
...
...
@@ -864,6 +872,7 @@ namespace dlib
void
_private_set_mxArray
(
mxArray
*
)
{
DLIB_CASSERT
(
false
,
"This function should never be called."
);
}
mxArray
*
_private_release_mxArray
(){
DLIB_CASSERT
(
false
,
"This function should never be called."
);
}
void
_private_mark_non_persistent
()
{
DLIB_CASSERT
(
false
,
"This function should never be called."
);
}
bool
_private_is_persistent
()
{
DLIB_CASSERT
(
false
,
"This function should never be called."
);
}
#endif
private
:
...
...
@@ -930,6 +939,7 @@ namespace dlib
void
_private_set_mxArray
(
mxArray
*
)
{
DLIB_CASSERT
(
false
,
"This function should never be called."
);
}
mxArray
*
_private_release_mxArray
(){
DLIB_CASSERT
(
false
,
"This function should never be called."
);
}
void
_private_mark_non_persistent
()
{
DLIB_CASSERT
(
false
,
"This function should never be called."
);
}
bool
_private_is_persistent
()
{
DLIB_CASSERT
(
false
,
"This function should never be called."
);
}
#endif
long
nr
(
...
...
@@ -1031,6 +1041,10 @@ namespace dlib
DLIB_CASSERT
(
mem
==
0
,
"You can't convert a persistent matlab array to non-persistent."
);
make_persistent
=
false
;
}
bool
_private_is_persistent
()
{
return
make_persistent
;
}
void
swap
(
layout
&
item
...
...
@@ -1153,6 +1167,10 @@ namespace dlib
DLIB_CASSERT
(
mem
==
0
,
"You can't convert a persistent matlab array to non-persistent."
);
make_persistent
=
false
;
}
bool
_private_is_persistent
()
{
return
make_persistent
;
}
void
swap
(
layout
&
item
...
...
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