ndstrides: [6] Implement np_reshape() #516

Open
lyken wants to merge 2 commits from ndstrides-6-reshape into ndstrides-5-miscfuncs
Collaborator

Reimplemented np_reshape(), in IRRT.

  • np_reshape() can reshape an ndarray without making a copy of the data, under certain conditions.
  • (Partially) solves issue: #278 (ndarray: Implement reshaping). See below for why this is "partial".

NOTE: In NumPy, np.reshape(<ndarray>) may or may not make a copy depending on if a reshape is "possible". Currently, NAC3's criterion is by simply checking NDArrayObject::is_c_contiguous() to decide whether or not to make a copy by playing around with the ndarray stride values, this is certainly different from how NumPy works.

Reimplemented `np_reshape()`, in IRRT. - `np_reshape()` can reshape an ndarray without making a copy of the data, under certain conditions. - (Partially) solves issue: https://git.m-labs.hk/M-Labs/nac3/issues/278 (ndarray: Implement reshaping). See below for why this is "partial". NOTE: In NumPy, `np.reshape(<ndarray>)` may or may not make a copy depending on if a reshape is "possible". Currently, NAC3's criterion is by simply checking `NDArrayObject::is_c_contiguous()` to decide whether or not to make a copy by playing around with the ndarray stride values, this is certainly different from how NumPy works.
lyken added 2 commits 2024-08-28 13:59:10 +08:00
lyken changed title from ndstrides-6-reshape to ndstrides: [6] Implement `np_reshape()` 2024-08-28 13:59:33 +08:00
lyken added a new dependency 2024-08-28 14:02:36 +08:00
lyken force-pushed ndstrides-6-reshape from 813dad4ed0 to 09fec5efaf 2024-08-30 14:37:55 +08:00 Compare
lyken force-pushed ndstrides-6-reshape from 09fec5efaf to 916a2b4993 2024-08-30 14:47:08 +08:00 Compare
Author
Collaborator

Rebased.

Rebased.
derppening force-pushed ndstrides-6-reshape from 916a2b4993 to f8c0e2c4dd 2024-10-18 13:37:24 +08:00 Compare
derppening force-pushed ndstrides-6-reshape from f8c0e2c4dd to 5427620f2e 2024-10-18 13:43:35 +08:00 Compare
derppening force-pushed ndstrides-6-reshape from 5427620f2e to 35704e1812 2024-10-18 14:24:55 +08:00 Compare
derppening force-pushed ndstrides-6-reshape from 35704e1812 to 926e7e93a8 2024-10-18 14:57:00 +08:00 Compare
This pull request can be merged automatically.
You are not authorized to merge this pull request.

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin ndstrides-6-reshape:ndstrides-6-reshape
git checkout ndstrides-6-reshape
Sign in to join this conversation.
No reviewers
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.

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