From 48e503438ca5742f7712213d54f3ad2a2fd63a1f Mon Sep 17 00:00:00 2001 From: Lingvo Maintenance Date: Mon, 14 Oct 2024 10:23:38 -0700 Subject: [PATCH] Attention layers now allow `None` paddings, remove assert. PiperOrigin-RevId: 685751950 --- lingvo/core/layers_with_attention.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/lingvo/core/layers_with_attention.py b/lingvo/core/layers_with_attention.py index dd2c14d7a..4a343220b 100644 --- a/lingvo/core/layers_with_attention.py +++ b/lingvo/core/layers_with_attention.py @@ -1500,7 +1500,6 @@ def FProp( if p.has_aux_atten: assert aux_vecs is not None - assert aux_paddings is not None with tf.name_scope('aux_atten'): atten_vec, atten_prob = self.atten.FProp(theta.atten, atten_vec, aux_paddings, aux_vecs, @@ -1550,7 +1549,6 @@ def ExtendStep(self, if p.has_aux_atten: assert aux_vecs is not None - assert aux_paddings is not None batch_size = py_utils.GetShape(source_vecs)[0]