Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
dlib
Commits
5162c984
Commit
5162c984
authored
Oct 18, 2015
by
Davis King
Browse files
Fixed tensor move constructor
parent
de34309c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
2 deletions
+14
-2
dlib/dnn/tensor.h
dlib/dnn/tensor.h
+14
-2
No files found.
dlib/dnn/tensor.h
View file @
5162c984
...
@@ -153,8 +153,20 @@ namespace dlib
...
@@ -153,8 +153,20 @@ namespace dlib
*
this
=
item
;
*
this
=
item
;
}
}
tensor
(
tensor
&&
item
)
=
default
;
tensor
(
tensor
&&
item
)
:
tensor
()
{
swap
(
item
);
}
tensor
&
operator
=
(
tensor
&&
item
)
=
default
;
tensor
&
operator
=
(
tensor
&&
item
)
{
swap
(
item
);
return
*
this
;
}
void
swap
(
tensor
&
item
)
{
std
::
swap
(
m_n
,
item
.
m_n
);
std
::
swap
(
m_nr
,
item
.
m_nr
);
std
::
swap
(
m_nc
,
item
.
m_nc
);
std
::
swap
(
m_k
,
item
.
m_k
);
std
::
swap
(
data
,
item
.
data
);
#ifdef DLIB_USE_CUDA
std
::
swap
(
cudnn_descriptor
,
item
.
cudnn_descriptor
);
#endif
}
long
m_n
;
long
m_n
;
...
...
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