"docs-source/vscode:/vscode.git/clone" did not exist on "87a70daf1753105594cc8996aabdc66daddfcd6f"
Commit 5fb1e359 authored by yanyan's avatar yanyan
Browse files

fix lambda capture problem in gcc 5

parent 02eb1d56
...@@ -833,13 +833,13 @@ struct Tensor { ...@@ -833,13 +833,13 @@ struct Tensor {
auto tensor = Tensor(); auto tensor = Tensor();
Dispatch<detail::all_tensor_types_t>()(dtype, [&](auto Idst) { Dispatch<detail::all_tensor_types_t>()(dtype, [&](auto Idst) {
using Tdst = decltype(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); using Tcur = decltype(Icur);
if (std::is_convertible<Tcur, Tdst>::value) { if (std::is_convertible<Tcur, Tdst>::value) {
auto ptr = data<Tcur>(); auto ptr = this->data<Tcur>();
tensor = Tensor(shape_, stride_, dtype, device(), pinned(), tensor = Tensor(this->shape_, this->stride_, dtype, this->device(), this->pinned(),
storage_->managed()); this->storage_->managed());
std::copy(ptr, ptr + size(), tensor.data<Tdst>()); std::copy(ptr, ptr + this->size(), tensor.data<Tdst>());
} else { } else {
TV_THROW_INVALID_ARG("not convertable from", type_s<Tcur>, "to", TV_THROW_INVALID_ARG("not convertable from", type_s<Tcur>, "to",
type_s<Tdst>); type_s<Tdst>);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment