Skip to content

Commit 3c3df53

Browse files
lingvo-botcopybara-github
authored andcommitted
Fix seemingly broken padding semantics in praxis/convolutions.py and lingvo/conv_layers_with_time_padding.py
I added a few tests passing NaN showing that at least now it seems to work. I'll be happy to take comments on how to progress and possibly split this up. PiperOrigin-RevId: 489153651
1 parent 1f1735b commit 3c3df53

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lingvo/core/conv_layers_with_time_padding.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -338,7 +338,7 @@ def FProp(self, theta, inputs, paddings):
338338

339339
def _ApplyPadding(tensor_in, padding_in):
340340
padding_expanded = tf.expand_dims(tf.expand_dims(padding_in, -1), -1)
341-
return tensor_in * (1.0 - padding_expanded)
341+
return py_utils.ApplyPadding(padding_expanded, tensor_in)
342342

343343
# Zeroing out padded inputs.
344344
inputs = _ApplyPadding(inputs, paddings)

0 commit comments

Comments
 (0)