'Get the op to sync local model_variables to PS.'

def _get_sync_model_vars_op(self):

    ops = []
    for (shadow_v, local_v) in self._shadow_model_vars:
        ops.append(shadow_v.assign(local_v.read_value()))
    assert len(ops)
    return tf.group(name='sync_{}_model_variables_to_ps'.format(len(ops)), *ops)
