Skip to content

Commit

Permalink
apply black
Browse files Browse the repository at this point in the history
  • Loading branch information
YosukeHiguchi committed Feb 28, 2022
1 parent 3251ed4 commit 4604a2d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
6 changes: 2 additions & 4 deletions test/espnet2/asr/encoder/test_conformer_encoder.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,14 +59,12 @@ def test_encoder_forward_backward(
x = torch.randn(2, 32, 20, requires_grad=True)
x_lens = torch.LongTensor([32, 28])
if len(interctc_layer_idx) > 0:
ctc=None
ctc = None
if interctc_use_conditioning:
vocab_size = 5
output_size = encoder.output_size()
ctc = CTC(odim=vocab_size, encoder_output_size=output_size)
encoder.conditioning_layer = torch.nn.Linear(
vocab_size, output_size
)
encoder.conditioning_layer = torch.nn.Linear(vocab_size, output_size)
y, _, _ = encoder(x, x_lens, ctc=ctc)
y = y[0]
else:
Expand Down
6 changes: 2 additions & 4 deletions test/espnet2/asr/encoder/test_transformer_encoder.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,12 @@ def test_Encoder_forward_backward(
x = torch.randn(2, 10, 20, requires_grad=True)
x_lens = torch.LongTensor([10, 8])
if len(interctc_layer_idx) > 0:
ctc=None
ctc = None
if interctc_use_conditioning:
vocab_size = 5
output_size = encoder.output_size()
ctc = CTC(odim=vocab_size, encoder_output_size=output_size)
encoder.conditioning_layer = torch.nn.Linear(
vocab_size, output_size
)
encoder.conditioning_layer = torch.nn.Linear(vocab_size, output_size)
y, _, _ = encoder(x, x_lens, ctc=ctc)
y = y[0]
else:
Expand Down

0 comments on commit 4604a2d

Please sign in to comment.