ndarray: Implement reshaping #278

Open
opened 2022-04-27 10:52:07 +08:00 by sb10q · 1 comment
Owner

This is trivial in principle, but slightly cumbersome to implement in practice if we want to support wildcards (-1) for an arbitrary number of dimensions, at least if we need to make the compiler emit the necessary code.

(Definitely a solvable issue, but it seems wrong to bake so much logic into the compiler; should probably lower to a runtime function that gets passed a pointer/length pair pointing to the source and target extent tuples.)

Originally posted by @dpn in M-Labs/artiq-zynq#125 (comment)

This is trivial in principle, but slightly cumbersome to implement in practice if we want to support wildcards (`-1`) for an arbitrary number of dimensions, at least if we need to make the compiler emit the necessary code. (Definitely a solvable issue, but it seems wrong to bake so much logic into the compiler; should probably lower to a runtime function that gets passed a pointer/length pair pointing to the source and target extent tuples.) _Originally posted by @dpn in https://git.m-labs.hk/M-Labs/artiq-zynq/issues/125#issue-378_
dpn was assigned by sb10q 2022-04-27 11:00:45 +08:00
dpn was unassigned by sb10q 2024-06-20 15:48:31 +08:00
Collaborator

np_reshape() is currently in master after PR #478 in commit 00236f48bc. -1 is supported.

However, np_reshape() copies the entire array.

`np_reshape()` is currently in `master` after PR https://git.m-labs.hk/M-Labs/nac3/pulls/478 in commit https://git.m-labs.hk/M-Labs/nac3/commit/00236f48bc57c112566edaea4ca36063bb647c7b. `-1` is supported. However, `np_reshape()` copies the entire array.
Sign in to join this conversation.
No Milestone
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: M-Labs/nac3#278
No description provided.