Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Fix crash in new cuda tensor with numpy array#5850

Merged
soumith merged 1 commit into
pytorch:masterfrom
vedanuj:fix_ndarray_cuda
Mar 17, 2018
Merged

Fix crash in new cuda tensor with numpy array#5850
soumith merged 1 commit into
pytorch:masterfrom
vedanuj:fix_ndarray_cuda

Conversation

@vedanuj
Copy link
Copy Markdown
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
Copy Markdown
Collaborator

soumith commented Mar 17, 2018

lgtm, thanks vedanuj!

@vedanuj vedanuj deleted the fix_ndarray_cuda branch March 21, 2018 06:55
laurentdupin pushed a commit to laurentdupin/pytorch that referenced this pull request Apr 24, 2026
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