Skip to content

Copy and deep copy of array #1029

Answered by awni
zcbenz asked this question in Q&A
Discussion options

You must be logged in to vote

The comment there just indicates that copy(p, s) is not going to make a new data buffer to back it's output, it will just be a view of the same data as p.

There is no real "deep copy" in MLX in the sense of an operation which forces a new data buffer to be allocated and copied into. We have no plans to expose one. Data buffers are managed by primitives and the runtime which is at a lower level and having complete control over that is useful.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by zcbenz
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants