Skip to content

Introduce Buffer type and make Array an abstraction on top of it #12447

Closed

Description

There's been some talk of switching to a model for arrays with two parts (and similar for strings) as part of Arrrayageddon:

  1. A memory buffer type, which is just a linear set of bytes
  2. An array, which holds a reference to its backing memory buffer and stores shape and stride information.

A few advantages:

  1. The distinction between and a subarray becomes smaller (or disappears): both are just views on a memory buffer.
  2. Array logic could be totally moved from C to Julia - only the buffer type would be defined in C.
  3. It's easier to reason about when different array instances are aliasing memory - if they have the same backing buffer, they're aliased.
  4. You could dynamically change the backing buffer of an array.

This is essentially the model that Torch uses, where the memory buffer is the Storage type and the array abstraction is the Tensor type.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    arrays[a, r, r, a, y, s]

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions