Skip to content

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

Closed
@antonwolfy

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

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