(self, outputs: DecodeOutputs, *, blank_id: int)
| 551 | ) |
| 552 | |
| 553 | def _check_paddings(self, outputs: DecodeOutputs, *, blank_id: int): |
| 554 | # Padding positions should correspond to pad_id. |
| 555 | self.assertTrue(jnp.all(outputs.sequences * outputs.paddings == 0)) |
| 556 | # Other positions should not contain pad_id or blanks. |
| 557 | self.assertTrue(jnp.all((outputs.sequences != 0) | outputs.paddings)) |
| 558 | if blank_id != 0: |
| 559 | self.assertTrue(jnp.all((outputs.sequences != blank_id) | outputs.paddings)) |
| 560 | |
| 561 | @parameterized.product( |
| 562 | num_decodes=[1, 3], |
no outgoing calls
no test coverage detected