Mutating array not supported

I think your function Discriminator() constructs the layer, and this mutates. Whereas in mean(Discriminator()(hcat(G.(eachcol(Z))...))) more likely you want to call what it returns, to use the same parameters more than once?