Outer product of more than two vectors

Got it :slight_smile:

julia> outer_product2(vs) =  .*([reshape(vs[d], (ntuple(Returns(1), d-1)..., :)) for d in 1:length(vs)]... )

julia> @benchmark outer_product($vs)
BenchmarkTools.Trial: 10000 samples with 5 evaluations.
 Range (min … max):  6.045 ΞΌs …  1.440 ms  β”Š GC (min … max): 0.00% … 98.98%
 Time  (median):     6.857 ΞΌs              β”Š GC (median):    0.00%
 Time  (mean Β± Οƒ):   7.907 ΞΌs Β± 31.443 ΞΌs  β”Š GC (mean Β± Οƒ):  8.84% Β±  2.21%

   β–…β–ƒβ–„β–ƒβ–β–ˆ                                                     
  β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‡β–…β–„β–ƒβ–ƒβ–ƒβ–‚β–ƒβ–‚β–ƒβ–‚β–„β–ƒβ–‚β–‚β–‚β–‚β–‚β–‚β–‚β–‚β–‚β–‚β–‚β–‚β–‚β–‚β–‚β–β–‚β–‚β–‚β–‚β–‚β–‚β–‚β–‚β–‚β–‚β–‚β–‚β–‚β–‚β–‚β–‚β–‚β–‚β–‚β–‚β–‚β–‚ β–ƒ
  6.04 ΞΌs        Histogram: frequency by time        15.6 ΞΌs <

 Memory estimate: 5.11 KiB, allocs estimate: 135.

julia> @benchmark outer_product2($vs)
BenchmarkTools.Trial: 10000 samples with 10 evaluations.
 Range (min … max):  1.632 ΞΌs … 591.462 ΞΌs  β”Š GC (min … max): 0.00% … 99.03%
 Time  (median):     1.880 ΞΌs               β”Š GC (median):    0.00%
 Time  (mean Β± Οƒ):   2.032 ΞΌs Β±   5.930 ΞΌs  β”Š GC (mean Β± Οƒ):  2.88% Β±  0.99%

     β–ˆβ–ˆβ–ƒβ– β–„β–‚ β–‚ ▁▂                                              
  β–‚β–„β–‡β–ˆβ–ˆβ–ˆβ–ˆβ–‡β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–†β–ˆβ–†β–„β–ƒβ–„β–ƒβ–ƒβ–ƒβ–ƒβ–ƒβ–ƒβ–„β–„β–‚β–‚β–‚β–‚β–‚β–‚β–‚β–‚β–‚β–‚β–‚β–ƒβ–„β–ƒβ–‚β–‚β–‚β–ƒβ–‚β–‚β–β–β–β–β–β–‚β–‚β–β– β–ƒ
  1.63 ΞΌs         Histogram: frequency by time        2.82 ΞΌs <

 Memory estimate: 752 bytes, allocs estimate: 15.

thanks :slight_smile: