Minor fix for the nondeterministic seed of tree_aggregation.GaussianNoiseGenerator. The previous log results won't change much, while one seed is probably good enough.

PiperOrigin-RevId: 390412713
This commit is contained in:
Zheng Xu 2021-08-12 11:02:46 -07:00 committed by A. Unique TensorFlower
parent b8c1ba72cd
commit 50673fec40

View file

@ -94,10 +94,12 @@ class GaussianNoiseGenerator(ValueGenerator):
An initial state. An initial state.
""" """
if self.seed is None: if self.seed is None:
time_now = tf.timestamp()
residual = time_now - tf.math.floor(time_now)
return tf.cast( return tf.cast(
tf.stack([ tf.stack([
tf.math.floor(tf.timestamp() * 1e6), tf.math.floor(tf.timestamp() * 1e6),
tf.math.floor(tf.math.log(tf.timestamp() * 1e6)) tf.math.floor(residual * 1e9)
]), ]),
dtype=tf.int64) dtype=tf.int64)
else: else: