def get_noised_result(self, sample_state, global_state):
    'See base class.'
    if (LooseVersion(tf.__version__) < LooseVersion('2.0.0')):

        def add_noise(v):
            return (v + tf.random.normal(tf.shape(input=v), stddev=global_state.stddev))
    else:
        random_normal = tf.random_normal_initializer(stddev=global_state.stddev)

        def add_noise(v):
            return (v + random_normal(tf.shape(input=v)))
    if self._ledger:
        dependencies = [self._ledger.record_sum_query(global_state.l2_norm_clip, global_state.stddev)]
    else:
        dependencies = []
    with tf.control_dependencies(dependencies):
        return (tf.nest.map_structure(add_noise, sample_state), global_state)
See base class.
def get_noised_result(self, sample_state, global_state):
    
    if (LooseVersion(tf.__version__) < LooseVersion('2.0.0')):

        def add_noise(v):
            return (v + tf.random.normal(tf.shape(input=v), stddev=global_state.stddev))
    else:
        random_normal = tf.random_normal_initializer(stddev=global_state.stddev)

        def add_noise(v):
            return (v + random_normal(tf.shape(input=v)))
    if self._ledger:
        dependencies = [self._ledger.record_sum_query(global_state.l2_norm_clip, global_state.stddev)]
    else:
        dependencies = []
    with tf.control_dependencies(dependencies):
        return (tf.nest.map_structure(add_noise, sample_state), global_state)