InferPy icon indicating copy to clipboard operation
InferPy copied to clipboard

reset_tf_vars performance

Open rcabanasdepaz opened this issue 8 years ago • 0 comments

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

rcabanasdepaz avatar Jun 05 '18 08:06 rcabanasdepaz