Skip to content

[RFC]: add ndarray/base/tile #253

@headlessNode

Description

@headlessNode

Construct a new ndarray by repeating the elements of an input ndarray a specified number of times along each dimension.

API:

tile( x, reps )

Parameters:

  • x — input ndarray
  • reps — array of repetitions for each dimension

Design constraints:

  • reps must have at least ndims(x) elements.
  • If reps.length > ndims(x), treat x as if singleton dimensions were prepended (without actually creating a new ndarray).
  • Returns a new ndarray.

Rationale for requiring reps.length >= ndims(x):

In NumPy, reps can have fewer elements than ndims(x), which makes it impossible to infer the output rank from the call site alone. By requiring reps.length >= ndims(x), the output rank is always equal to reps.length, making code easier to reason about.

Related:

Metadata

Metadata

Assignees

Labels

FeatureTask to add a new feature.difficulty: 2May require some initial design or R&D, but should be straightforward to resolve and/or implement.estimate: 2-4hrsTask which should take between 2 to 4 hours.priority: HighHigh priority concern or feature request.🤖 AIAllowed to use AI.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions