Thanks. I noticed that right after I posted but couldn't find my post to fix it. Here's a working version
using Base.Cartesian stagedfunction convn{T,N}(A::Array{T,N}, B::Array{T,N}) quote retsize = [size(A)...] + [size(B)...] - 1 retsize = tuple(retsize...) ret = zeros(T, retsize) @nloops $N i A begin @nloops $N j B begin (@nref $N ret d->(i_d + j_d - 1)) += (@nref $N A i) * (@nref $N B j) end end return ret end end On Monday, April 13, 2015 at 8:06:08 PM UTC-5, Tim Holy wrote: > > You forgot the $N on the two @nref on the right hand side: > > On Monday, April 13, 2015 08:05:15 AM Derek Thomas wrote: > > (@nref $N ret k->(i_d + j_d)) = (@nref A i) * (@nref B > j) > > --Tim >