-
Notifications
You must be signed in to change notification settings - Fork 131
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
Numpy fill accepts also variables #1420
Numpy fill accepts also variables #1420
Conversation
It is now a bit nicer, less compact but much more readable. Further, one function should now be much clearer how it works and it now guarantees that the same Python resolution order is used.
While this PR allows for code such as: import dace
import numpy as np
N = dace.symbol("N", dace.int32)
@dace.program
def fill_dace(A: dace.float64[N, N], value: dace.float64):
A.fill(value) it does currently not allows for code such as: @dace.program
def fill_dace_not_working(A: dace.float64[N, N], value: dace.float64):
A.fill(value + 1) The reason is that the argument to What is funny though is that the code: @dace.program
def fill_dace_does_also_not_work(A: dace.float64[N, N], value: dace.float64):
value2 = value + 1
A.fill(value2) will also not work but: @dace.program
def fill_dace_will_work_but_why(A: dace.float64[N, N], value: dace.float64):
value2 = value + 1
A.fill(value2)
return value2 will work, for some strange reason and I have no idea why? Disturbingly this: @dace.program
def fill_dace_why_god_does_this_not_work(A: dace.float64[N, N], value: dace.float64):
value2 = value + 1
A.fill(value2)
return value does not work, and I have no idea why? For more see samples/simple/numpy_fill.py |
Note the programm shows the current state and not what is desired.
The logic of the check has changed, but I forget to change the check itself. Why was that thing working before?
Current State:
|
…ocaly defined variable. It Addresses the last point mentioned in the discussion of PR [spcl#1420](spcl#1420 (comment)). However, there is still a problem in case an expression is passed as argument. Now the problem is that there is some shadowing.
It is no longer based on `_elementwise()` but is now a dedicated implementation, which is based on `full()`.
Commit a29ae4a should now solve everything of the above list. |
Added Ben's Suggestions. Co-authored-by: BenWeber42 <[email protected]>
Co-authored-by: BenWeber42 <[email protected]>
This PR is for addressing issue #1389.