Skip to content

aminmax increases dimension from 0-dim to 1-dim when given scalar inputs and keepdim. #64008

@Chillee

Description

@Chillee
>>> torch.aminmax(torch.randn(()), dim=0, keepdim=True)
torch.return_types.aminmax(
min=tensor([1.9132]),
max=tensor([1.9132]))

>>> torch.nansum(torch.randn(()), dim=0, keepdim=True)
tensor(0.6512)

>>> torch.argmax(torch.randn(()), dim=0, keepdim=True)
tensor(0)

We should probably make this consistent.

torch.aminmax is increasing the dimension from a 0-dim tensor to a 1-dim tensor.

cc @heitorschueroff

Metadata

Metadata

Assignees

No one assigned

    Labels

    module: reductionstriagedThis issue has been looked at a team member, and triaged and prioritized into an appropriate module

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions