Skip to content

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

Closed
@oleksandr-pavlyk

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])

Metadata

Metadata

Labels

bugSomething isn't workingtensor

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions