File tree Expand file tree Collapse file tree 1 file changed +3
-6
lines changed
tensorflow_asr/augmentations Expand file tree Collapse file tree 1 file changed +3
-6
lines changed Original file line number Diff line number Diff line change @@ -57,12 +57,9 @@ class Augmentation:
5757 def __init__ (self , config : dict = None , use_tf : bool = False ):
5858 if not config : config = {}
5959 prob = float (config .pop ("prob" , 0.5 ))
60- if use_tf :
61- self .before = self .tf_parse (config .pop ("before" , {}), prob = prob )
62- self .after = self .tf_parse (config .pop ("after" , {}), prob = prob )
63- else :
64- self .before = self .parse (config .pop ("before" , {}), prob = prob )
65- self .after = self .parse (config .pop ("after" , {}), prob = prob )
60+ parser = self .tf_parse if use_tf else self .parse
61+ self .before = parser (config .pop ("before" , {}), prob = prob )
62+ self .after = parser (config .pop ("after" , {}), prob = prob )
6663
6764 @staticmethod
6865 def parse (config : dict , prob : float = 0.5 ) -> naf .Sometimes :
You can’t perform that action at this time.
0 commit comments