Skip to content

torch.count_nonzero fails with axis tuple and keepdims=True #311

Closed
@mdhaber

Description

@mdhaber
from array_api_compat import torch as xp
x = xp.asarray([1])
xp.count_nonzero(x, axis=(0,), keepdims=True)
# TypeError: unsqueeze(): argument 'dim' (position 1) must be int, not tuple

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions