Skip to content

RFC: add support for creating a new array by tiling a provided array #655

@kgryte

Description

@kgryte

This RFC proposes adding support to the array API specification for creating a new array by tiling a provided array.

Overview

Based on array comparison data, the API is available in all array libraries.

Prior art

Proposal

def tile(x: array, repetitions: Union[int, Tuple[int, ...]], /)
  • repetitions: the number of repetitions of x along each axis. Let N = len(repetitions) and let M = len(x.shape).

    • if M < N, then x must be broadcasted to be N dimensional by prepending new axes.
    • if M > N, then repetitions must be broadcasted by prepending new axes.

Questions

  • Neither PyTorch nor TensorFlow support providing an int for repetitions. TensorFlow requires repetitions to be a Tensor. All array libraries apart from TensorFlow allow repetitions to be a tuple. Should repetitions be typed more strictly?

Related

Metadata

Metadata

Assignees

No one assigned

    Labels

    API extensionAdds new functions or objects to the API.topic: ManipulationArray manipulation and transformation.

    Type

    No type

    Projects

    Status

    Stage 2

    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