'Initialization assignment operator function used while training.'

def get_init_fn(self, scopes):

    if (not self._params.init_model):
        return None
    is_trainable = (lambda x: (x in tf.trainable_variables()))
    var_list = []
    for scope in scopes:
        var_list.extend(filter(is_trainable, tf.contrib.framework.get_model_variables(scope)))
    (init_assign_op, init_feed_dict) = slim.assign_from_checkpoint(self._params.init_model, var_list)
    def init_assign_function(sess):
        sess.run(init_assign_op, init_feed_dict)
    return init_assign_function
