Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support ndarray deepcopy in C++ wrapper of AOT api #6411

Open
ailzhang opened this issue Oct 24, 2022 · 3 comments
Open

Support ndarray deepcopy in C++ wrapper of AOT api #6411

ailzhang opened this issue Oct 24, 2022 · 3 comments
Assignees
Labels
feature request Suggest an idea on this project P1

Comments

@ailzhang
Copy link
Contributor

There're cases where users would want a deepcopy of an ndarray, so we can probably provide this as

auto arr_copy = arr.clone()

in our C++ wrapper.
cc: @YuCrazing

@ailzhang ailzhang added the feature request Suggest an idea on this project label Oct 24, 2022
@ailzhang ailzhang added this to the v1.3.0 milestone Oct 24, 2022
@taichi-gardener taichi-gardener moved this to Untriaged in Taichi Lang Oct 24, 2022
@YuCrazing YuCrazing added the P1 label Oct 24, 2022
@neozhaoliang neozhaoliang moved this from Untriaged to Todo in Taichi Lang Oct 28, 2022
@PENGUINLIONG
Copy link
Member

What's the intent tho? Do you want an actual deep-copy or just something like np.zeros_like?

@YuCrazing
Copy link
Contributor

In my case, I want an actual deep-copy. I would like to copy all data from ndarray A into ndarray B with the least codes. If we have a deep-copy interface, we do not need write
codes like this:

auto B = allocate_ndarray(A.shape, A.elem_shape, ...);
memcpy_d2d(B, A);

@PENGUINLIONG
Copy link
Member

hmm okay. there would be something like a clone.

@PENGUINLIONG PENGUINLIONG modified the milestones: v1.3.0, v1.4.0 Nov 25, 2022
@PENGUINLIONG PENGUINLIONG modified the milestones: v1.4.0, v1.5.0 Jan 4, 2023
@turbo0628 turbo0628 modified the milestones: v1.5.0, v1.6.0 Mar 10, 2023
@feisuzhu feisuzhu modified the milestones: v1.6.0, v1.7.0 May 11, 2023
@jim19930609 jim19930609 modified the milestone: v1.7.0 Oct 25, 2023
@jim19930609 jim19930609 removed this from the v1.7.0 milestone Nov 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request Suggest an idea on this project P1
Projects
Status: Todo
Development

No branches or pull requests

6 participants