We would like to make use of an 0.5 feature which fails to parse on 0.4
@static if Base.VERSION.major == 0 && Base.VERSION.minor < 5
sN = sparsevec(sum(N[1:ncategories[i],:], 1)) # Slower, but should be supported by Julia 0.4
else
sN = sum(N[i,:] for i=1:ncategories[i])
end
The problem with the above implementation is that Julia 0.4 still parses both branches, and thus fails. Is there a way to insert something like this such that you get the desired code in each Julia version?
Thank you!