Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crash when using tensor.set_data() function in libtorch on windows #21899

Open
njtuzzy opened this issue Jun 18, 2019 · 2 comments
Open

Crash when using tensor.set_data() function in libtorch on windows #21899

njtuzzy opened this issue Jun 18, 2019 · 2 comments
Labels
module: cpp Related to C++ API triaged This issue has been looked at a team member, and triaged and prioritized into an appropriate module

Comments

@njtuzzy
Copy link

njtuzzy commented Jun 18, 2019

❓ Questions and Help

When i use the the set_data function in libtorch as following, the exe will be crashed!
at:: Tensor a = torch::ones({3});
at::Tensor b = torch:: zeros({3});

a.set_data(b)
....
? do anyone know what's going on?

Thanks

Please note that this issue tracker is not a help form and this issue will be closed.

We have a set of listed resources available on the website. Our primary means of support is our discussion forum:

@pytorchbot pytorchbot added the module: windows Windows support for PyTorch label Jun 18, 2019
@njtuzzy njtuzzy changed the title Crash when using tensor.setdata() function in libtorch on windows Crash when using tensor.set_data() function in libtorch on windows Jun 18, 2019
@VitalyFedyunin
Copy link
Contributor

Can you please provide crash report? It will also help if you can send us full code.

@yf225 yf225 added the module: cpp Related to C++ API label Jun 26, 2019
@yf225
Copy link
Contributor

yf225 commented Jun 26, 2019

@njtuzzy Currently set_data is an API on torch::autograd::Variable, not at::Tensor. You can do #include <torch/csrc/autograd/variable.h>, and then call torch::autograd::as_variable_ref(a).set_data(b).

@yf225 yf225 added triaged This issue has been looked at a team member, and triaged and prioritized into an appropriate module and removed module: windows Windows support for PyTorch labels Jun 26, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
module: cpp Related to C++ API triaged This issue has been looked at a team member, and triaged and prioritized into an appropriate module
Projects
None yet
Development

No branches or pull requests

4 participants