Skip to content
This repository has been archived by the owner on Mar 30, 2022. It is now read-only.

Differentiable needs func moved(along: directions) -> Self #508

Open
dabrahams opened this issue Jul 30, 2020 · 0 comments
Open

Differentiable needs func moved(along: directions) -> Self #508

dabrahams opened this issue Jul 30, 2020 · 0 comments

Comments

@dabrahams
Copy link
Contributor

When a differentiable value uses heap storage and is multiply-referenced, move(along: directions) will first copy, and then update, the storage, which is inefficient. It should instead create new storage initialized with the result.

If you think about the way this plays out for an Array of differentiable values, you'll see that the only choice the Array currently has is to invoke e.move(along: d), in-place, which causes each element with shared storage to be copied and then updated.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant