Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
one
spconv
Commits
5fb1e359
Commit
5fb1e359
authored
May 29, 2020
by
yanyan
Browse files
fix lambda capture problem in gcc 5
parent
02eb1d56
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
5 deletions
+5
-5
include/tensorview/tensor.h
include/tensorview/tensor.h
+5
-5
No files found.
include/tensorview/tensor.h
View file @
5fb1e359
...
...
@@ -833,13 +833,13 @@ struct Tensor {
auto
tensor
=
Tensor
();
Dispatch
<
detail
::
all_tensor_types_t
>
()(
dtype
,
[
&
](
auto
Idst
)
{
using
Tdst
=
decltype
(
Idst
);
Dispatch
<
detail
::
all_tensor_types_t
>
()(
dtype_
,
[
&
](
auto
Icur
)
{
Dispatch
<
detail
::
all_tensor_types_t
>
()(
this
->
dtype_
,
[
&
](
auto
Icur
)
{
using
Tcur
=
decltype
(
Icur
);
if
(
std
::
is_convertible
<
Tcur
,
Tdst
>::
value
)
{
auto
ptr
=
data
<
Tcur
>
();
tensor
=
Tensor
(
shape_
,
stride_
,
dtype
,
device
(),
pinned
(),
storage_
->
managed
());
std
::
copy
(
ptr
,
ptr
+
size
(),
tensor
.
data
<
Tdst
>
());
auto
ptr
=
this
->
data
<
Tcur
>
();
tensor
=
Tensor
(
this
->
shape_
,
this
->
stride_
,
dtype
,
this
->
device
(),
this
->
pinned
(),
this
->
storage_
->
managed
());
std
::
copy
(
ptr
,
ptr
+
this
->
size
(),
tensor
.
data
<
Tdst
>
());
}
else
{
TV_THROW_INVALID_ARG
(
"not convertable from"
,
type_s
<
Tcur
>
,
"to"
,
type_s
<
Tdst
>
);
...
...
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