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
I am confused about how Polyester handles arguments to anonymous functions. In short, why does the last example below not work?
function temp(x, y)
return x + y
end
outputs = zeros(Float64, 100)
# This works
Polyester.@batch for i = 1:100
myfunc = x -> temp(x, i)
outputs[i] = myfunc(1)
end
# This also works
vals = collect(1:100)
Polyester.@batch for i = 1:100
outputs[i] = 1 + vals[i]
end
# This does not
vals = collect(1:100)
Polyester.@batch for i = 1:100
myfunc = x -> temp(x, vals[i])
outputs[i] = myfunc(1)
end
I am confused about how
Polyester
handles arguments to anonymous functions. In short, why does the last example below not work?Running it gives me the following error:
A related question is that if I instead define the function as the following, I get another error (that it does not recognize
myfunc
).Thanks for the help.
The text was updated successfully, but these errors were encountered: