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

broadcasting element-wise operation without materializing the data into Array? #27

Open
johnnychen94 opened this issue May 4, 2022 · 1 comment

Comments

@johnnychen94
Copy link
Member

johnnychen94 commented May 4, 2022

A = IndirectArray(rand(1:5, 64, 64), rand(1:10, 5))
float.(A) # what's needed to make this still an IndirectArray?

# internally, I'd like to make it work equivalently to
_float(A::IndirectArray) = IndirectArray(A.index, float.(A.values))
@timholy
Copy link
Member

timholy commented May 4, 2022

Since broadcasting acts on values only, I think (?) we could create custom copy!(::Broadcastable) methods for IndirectArray.

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

No branches or pull requests

2 participants