-
Notifications
You must be signed in to change notification settings - Fork 49
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
[cartesian] Numpy backend lacks non-literal accessor for data dimensions #1578
Comments
Thanks for reporting @FlorianDeconinck . Are you planning to also work in a fix or is it not high priority for you at the moment? |
Unclear. We need a fix for sure but we have a mounting amount of physics pattern difficult to write so other feature requests might take precedence. I'd say we are a few weeks away from deciding where we put our efforts |
So it seems this is going to be a slightly bigger work than a simple bug fix. The class LocalScalarAccess(VectorLValue):
name: eve.Coerced[eve.SymbolRef]
kind: common.ExprKind = common.ExprKind.FIELD We will have to refactor that first. |
Probable solution used for a POC of another feature: # The code as been modified to generate B[i:I,j:J,index]
# which is correct but will break because you can't brodcast 2D in 3D
# e.g. you can't write (for I, J, K the dimensions)
# > (I,J,K) = (I,J)
# we need to use push the 2D into 3D realm by re-establishing a 3rd axis, e.g:
# > A[i:I, j:J, k:K] = B[i:I, j:J, index][..., np.newaxis]
# This isn't true for FieldSlice which would lead to
# a (I, J, K) = (I, J, 1), which is structurally equal to the above extra axis add. |
The
numpy
backend has a limitation on literal accessor not shared by other backends.Consider the following:
We expect
n_iter
to be some kind of local scalar variable. Butnumpy
is trying to use as much inner parallelism and masking as possible leading to this code giving aMeanwhile, running this code under a
gt:X
ordace:X
backend gives the expected results (withn_iter
a local scalar`).PS: this was unearth looking at the Aer Activation physics code for NASA's GEOS model
The text was updated successfully, but these errors were encountered: