Open
Description
Currently, neither vanilla torch nor array-api-compat torch seem to accept the copy
keyword. (Or the device
keyword, of course, but that is probably harder to deal with.)
import numpy as np
import torch
from array_api_compat import array_namespace
xp = array_namespace(torch.asarray([1, 2, 3]))
x = np.asarray([1, 2, 3])
y = xp.from_dlpack(x, copy=False) # TypeError: from_dlpack() got an unexpected keyword argument 'copy'
y = torch.from_dlpack(x, copy=False) # TypeError: from_dlpack() got an unexpected keyword argument 'copy'
Should the array-api-compat version accept it, or does it need to wait for PyTorch itself?
Crossref scipy/scipy#21890
Metadata
Metadata
Assignees
Labels
No labels