Skip to content

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

Description

@antonwolfy

The problem comes from gh-1487:

import dpctl.tensor as dpt
import numpy

a = dpt.ones((0, 10))
dpt.sum(a, keepdims=True).shape 
# Out: ()

b = numpy.ones((0, 10))
numpy.sum(a, keepdims=True).shape 
# Out: (1,)

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