MCPcopy Create free account
hub / github.com/apple/axlearn / _check_paddings

Method _check_paddings

axlearn/audio/decoder_asr_test.py:553–559  ·  view source on GitHub ↗
(self, outputs: DecodeOutputs, *, blank_id: int)

Source from the content-addressed store, hash-verified

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],

Callers 2

test_greedy_decodeMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected