Skip to content

Commit 54200ec

Browse files
committed
✍️ update augmentation init
1 parent c2327cf commit 54200ec

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

tensorflow_asr/augmentations/augments.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,8 @@ def __init__(self, augmentations: list, prob: float = 0.5):
4848
def augment(self, inputs):
4949
outputs = inputs
5050
for au in self.augmentations:
51-
if tf.random.uniform([]) < self.prob:
52-
outputs = au.augment(outputs)
51+
p = tf.random.uniform([])
52+
outputs = tf.cond(tf.less(p, self.prob), true_fn=lambda: au.augment(outputs), false_fn=lambda: outputs)
5353
return outputs
5454

5555

0 commit comments

Comments
 (0)