Skip to content

array_api_compat.numpy.asarray(torch.Tensor) returns a torch.Tensor #106

Closed
@izaid

Description

@izaid

This feels like a bug to me. My expectation is that xp.asarray converts to an array object in the xp namespace if that operation is supported.

>>> import torch
>>> import array_api_compat.numpy
>>> x = torch.arange(10)
>>> array_api_compat.numpy.asarray(x)
tensor([0, 1, 2, 3, 4, 5, 6, 7, 8, 9])

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