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

[NDTensors] AllocateData library #1276

Merged
merged 4 commits into from
Dec 4, 2023
Merged

[NDTensors] AllocateData library #1276

merged 4 commits into from
Dec 4, 2023

Conversation

mtfishman
Copy link
Member

This introduces the AllocateData submodule library. The goal is to provide a common interface for allocating arrays of different types through the function allocate, for example:

# Allocate undefined data
allocate(Array{Float32}, (2, 2))
allocate(Diagonal{Float32}, (2, 2))

# Allocate zeros
allocate_zeros(Array{Float32}, (2, 2))
allocate_zeros(Diagonal{Float32}, (2, 2))

This is related to the generic_zeros functionality in NDTensors, with a goal of being more principled and general.

It could also be used by the UnallocatedArrays library being introduced by @kmp5VT in #1213.

@mtfishman mtfishman merged commit 0ff3110 into main Dec 4, 2023
8 of 9 checks passed
@mtfishman mtfishman deleted the NDTensors_AllocateData branch December 4, 2023 19:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant