| 3817 | # That's what the tile call does, it just repeats the mask along its |
| 3818 | # second dimension n times. |
| 3819 | def _expand_mask(mask_t, input_t, fixed_dim=1): |
| 3820 | assert not nest.is_sequence(mask_t) |
| 3821 | assert not nest.is_sequence(input_t) |
| 3822 | rank_diff = len(input_t.shape) - len(mask_t.shape) |
| 3823 | for _ in range(rank_diff): |
| 3824 | mask_t = array_ops.expand_dims(mask_t, -1) |
| 3825 | multiples = [1] * fixed_dim + input_t.shape.as_list()[fixed_dim:] |
| 3826 | return array_ops.tile(mask_t, multiples) |
| 3827 | |
| 3828 | if unroll: |
| 3829 | if not time_steps: |