With eval(), the NumPy function is only evaluated once. It outputs loc parameters to the normal random variable and is a constant NumPy array.

If you’d like y's location parameter to change across session runs, the function has to be part of the computational graph (i.e., written in TensorFlow).

Thank you for the quick response, that makes sense.

The function I’m trying to evaluate is a Keras deep network. Do you know, by any chance, if it is possible to pass tensorflow variables to a Keras deep network? I haven’t been able but maybe there’s a way.