Skip to content

dpnp.atleast_3d() is very slow and have a different shape compared to numpy.atleast_3d() with 2d array. #1342

Description

@npolina4

dpnp.atleast_3d() have a different shape compared to numpy.atleast_3d() with 2d array.

In [1]: import dpnp, numpy

In [2]: xnp = numpy.ones((1000, 1000))

In [3]: %time numpy.atleast_3d(xnp)
CPU times: user 17 µs, sys: 4 µs, total: 21 µs
Wall time: 24.6 µs

In [4]: x = dpnp.ones((1000, 1000))

In [6]: %time dpnp.atleast_3d(x)
CPU times: user 2min 1s, sys: 1min 4s, total: 3min 6s
Wall time: 2min 52s

And dpnp.atleast_3d() have a different shape compared to numpy.atleast_3d() with 2d array.

In [1]: import dpnp, numpy

In [2]: xnp = numpy.ones((1000, 1000))

In [3]: numpy.atleast_3d(xnp).shape
(1000, 1000, 1)

In [4]: x = dpnp.ones((1000, 1000))

In [5]: dpnp.atleast_3d(x).shape
(1, 1000, 1000)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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