Hello,
I am reading and experimenting with generated functions. The docs mention to give the compiler an option to use or not use the generated function using the construction
function foo(x)
if @generated
:(x+x)
else
x + x
end
end
The documentation is not very clear about at which conditions the compiler decides to use it and when not? I would like to understand these conditions, because I have just found that @generated functions can be sometimes used to create a nicer code for Zygote (manually unrolling map
for example).
Thanks for an answer,
Tomas