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.
This pull request can be merged automatically.
You are not authorized to merge this pull request.
You can also view command line instructions.

Step 1:

From your project repository, check out a new branch and test the changes.
git checkout -b ndstrides-6-reshape ndstrides-5-miscfuncs
git pull origin ndstrides-6-reshape

Step 2:

Merge the changes and update on Gitea.
git checkout ndstrides-5-miscfuncs
git merge --no-ff ndstrides-6-reshape
git push origin ndstrides-5-miscfuncs
Sign in to join this conversation.
No reviewers
No Milestone
No Assignees
1 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.