Black box code for computation of a mean

This has been asked on stack overflow before. It seems like theano’s problem to compile graphs on OS X machines.