You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Sorry this package really needs a manual, but I got busy.
@tullio out[x, y] = right evaluates right and writes into out, possibly summing. @tullio out[x, y] := right makes a new array. The macro completely rewrites how this looks.
But what appears within the expression on the right isn't processed much, and at some point I allowed it to take an arbitrary block of code. The code is read (to figure out what indices appear, etc.) but evaluated as it stands. So = has no special meaning, it's just a normal block of code, and the last statement is its value, as usual.
The option verbose=2 will print everything, and the main loop here looks like this:
│ for y = 𝒶𝓍y
│ for x = 𝒶𝓍x
│ 𝒜𝒸𝒸 =if ♻️ ===nothing
│ zero(𝒯)
│ else
│ ℛ[x, y] # this is part of how it handles memory blocking, allows a re-start
│ end
│ for k = 𝒶𝓍k # this is the sum loop
│ 𝒜𝒸𝒸 = 𝒜𝒸𝒸 +@inbounds(begin# this is the block of code provided, untouched
│ (a, b) = off[k]
│ mat[mod(x + a), mod(y + b)]
│ end)
│ end
│ ℛ[x, y] = 𝒜𝒸𝒸 # writing into an output array, created outside this function
│ end
│ end
In the README, looking at the following snippet:
I struggled in my code until I made sure that:
:=
afterout[x, y]
can either be:=
or=
as described above the snippet.begin ... end
, only=
can be used. This is not mentioned anywhere.I wanted to change that with a PR. But I want to confirm first.
Is that correct?
The text was updated successfully, but these errors were encountered: