Skip to content

Commit c739a5e

Browse files
committed
add cornercase test
Signed-off-by: Ngoc Minh Tran <[email protected]>
1 parent c7c282c commit c739a5e

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

tests/estimators/speech_recognition/test_pytorch_deep_speech.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,19 @@ def _test_all(self, request, setup_class):
183183
expected_transcriptions = np.array(["", "", ""])
184184
assert (expected_transcriptions == transcriptions).all()
185185

186+
# Test transcription outputs, corner case
187+
if request.param is True:
188+
transcriptions = self.speech_recognizer_amp.predict(
189+
np.array([self.x[0]]), batch_size=2, transcription_output=True
190+
)
191+
else:
192+
transcriptions = self.speech_recognizer.predict(
193+
np.array([self.x[0]]), batch_size=2, transcription_output=True
194+
)
195+
196+
expected_transcriptions = np.array([""])
197+
assert (expected_transcriptions == transcriptions).all()
198+
186199
# Now test loss gradients
187200
# Create labels
188201
y = np.array(["SIX", "HI", "GOOD"])

0 commit comments

Comments
 (0)