Created
October 30, 2024 08:16
-
-
Save yuhanz/c502edd1cb69169177896aa6083a0574 to your computer and use it in GitHub Desktop.
Put pytorch array as numba.cuda array
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import numba.cuda | |
| import torch | |
| import numpy as np | |
| t = torch.from_numpy(np.array([1,2,3])) | |
| numba.cuda.as_cuda_array(t.to('cuda')) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment