8000 Should array-api-compat torch `from_dlpack` accept `copy`? · Issue #204 · data-apis/array-api-compat · GitHub
[go: up one dir, main page]

Skip to content
Should array-api-compat torch from_dlpack accept copy? #204
Open
@mdhaber

Description

@mdhaber

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

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0