Skip to content

Fix crash in new cuda tensor with numpy array #5850

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

Merged
merged 1 commit into from
Mar 17, 2018
Merged

Fix crash in new cuda tensor with numpy array #5850

merged 1 commit into from
Mar 17, 2018

Conversation

vedanuj
Copy link
Contributor

@vedanuj vedanuj commented Mar 17, 2018

Fixes segfault in #5821 . Releasing the Global Interpreter Lock after maybe_initialize_cuda.

Test ::

In [3]: data = np.array([1.0])

In [4]: torch.tensor(data, dtype=torch.float32)
Out[4]:
 1
[torch.FloatTensor of size (1,)]

In [5]: torch.tensor(data, dtype=torch.cuda.float32)
Out[5]:

 1
[torch.cuda.FloatTensor of size (1,) (GPU 0)]

Please review @colesbury @gchanan

@soumith soumith merged commit d441396 into pytorch:master Mar 17, 2018
@soumith
Copy link
Member

soumith commented Mar 17, 2018

lgtm, thanks vedanuj!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants