Skip to content

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

@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

      pFad - Phonifier reborn

      Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

      Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy