Skip to content

dpctl.tensor.asarray must support sequences of usm_ndarrays #1134

Closed

Description

@oleksandr-pavlyk

An example where this arises naturally is

   x = dpt.arange(3)
   dpt.asarray([
       x[0], x[1], x[2]
   ])

It would arise even more naturally with addition of dpt.unstack where it would be as simple as dpt.asarray( dpt.unstack(x)).

The present work-around is to use dpt.stack:

In [13]: x = dpt.arange(5)

In [14]: dpt.stack([ x[i] for i in range(x.shape[0])])
Out[14]: usm_ndarray([0, 1, 2, 3, 4])

Activity

  1. added
    bug
    on Mar 22, 2023
  2. added 3 commits that reference this issue on Mar 27, 2023
    c070c86
    e30a973
    7f0f48a
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

bugtensor

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions