From dad5680920e11b9cb0c8144c0df4e600d6823474 Mon Sep 17 00:00:00 2001 From: pkufool Date: Mon, 13 Sep 2021 17:34:07 +0800 Subject: [PATCH] Fix code style --- egs/librispeech/ASR/conformer_ctc/conformer.py | 2 -- egs/librispeech/ASR/conformer_ctc/train.py | 3 ++- egs/librispeech/ASR/tdnn_lstm_ctc/decode.py | 1 - 3 files changed, 2 insertions(+), 4 deletions(-) diff --git a/egs/librispeech/ASR/conformer_ctc/conformer.py b/egs/librispeech/ASR/conformer_ctc/conformer.py index bb02bf989..efe3570cb 100644 --- a/egs/librispeech/ASR/conformer_ctc/conformer.py +++ b/egs/librispeech/ASR/conformer_ctc/conformer.py @@ -452,7 +452,6 @@ class RelPositionMultiheadAttention(nn.Module): self._reset_parameters() - def _reset_parameters(self) -> None: nn.init.xavier_uniform_(self.in_proj.weight) nn.init.constant_(self.in_proj.bias, 0.0) @@ -682,7 +681,6 @@ class RelPositionMultiheadAttention(nn.Module): _b = _b[_start:] v = nn.functional.linear(value, _w, _b) - if attn_mask is not None: assert ( attn_mask.dtype == torch.float32 diff --git a/egs/librispeech/ASR/conformer_ctc/train.py b/egs/librispeech/ASR/conformer_ctc/train.py index 2a72269d4..298b74112 100755 --- a/egs/librispeech/ASR/conformer_ctc/train.py +++ b/egs/librispeech/ASR/conformer_ctc/train.py @@ -139,7 +139,8 @@ def get_params() -> AttributeDict: - subsampling_factor: The subsampling factor for the model. - - use_feat_batchnorm: Whether to do batch normalization for the input features. + - use_feat_batchnorm: Whether to do batch normalization for the + input features. - attention_dim: Hidden dim for multi-head attention model. diff --git a/egs/librispeech/ASR/tdnn_lstm_ctc/decode.py b/egs/librispeech/ASR/tdnn_lstm_ctc/decode.py index 3335192c3..6001f0f13 100755 --- a/egs/librispeech/ASR/tdnn_lstm_ctc/decode.py +++ b/egs/librispeech/ASR/tdnn_lstm_ctc/decode.py @@ -108,7 +108,6 @@ def get_parser(): """, ) - parser.add_argument( "--export", type=str2bool,