InferPy
InferPy copied to clipboard
reset_tf_vars performance
In methods ProbModel.fit and ProbModel.predict, improve the performance of the following code:
for t in tf.global_variables():
if not sess.run(tf.is_variable_initialized(t)):
sess.run(tf.variables_initializer([t]))
Tip: with many TF vars in the current sessions, the condition in the if-statement will be evaluated lots of times