Skip to content

dpnp.sum with "keepsdims" returns incorrect shape in case one or more axis is equal to 0 #1487

@AlexanderKalistratov

Description

@AlexanderKalistratov
import dpnp
import numpy

a = dpnp.ones((0, 10))
b = a.sum(keepdims=True)
print("dpnp shape", b.shape)

a_np = numpy.ones((0, 10))
b_np = a_np.sum(keepdims=True)
print("numpy shape", b_np.shape)

result:

dpnp shape ()
numpy shape (1, 1)

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