Skip to content

reshape, broadcast_to, and permute_dims do not accept a single integer #608

Closed
@asmeurer

Description

@asmeurer

reshape, broadcast_to, and permute_dims (I think these are all but I could have missed one), all accept a Tuple[int, ...]. The shape parameter for reshape and broadcast_to for shape, and axis for permute_dims

Every other function that accepts this kind of parameter accepts Union[int, Tuple[int, ...]].

It was pointed out in data-apis/array-api-compat#28 that NumPy currently accepts ints for all of these (and indeed, numpy.array_api accidentally does), but PyTorch does not.

Metadata

Metadata

Assignees

No one assigned

    Labels

    status: RejectedProposed change was not accepted.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions