Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(lint): Fix flake8 lint #1604

Merged
merged 1 commit into from
Dec 7, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .flake8
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ ignore =
# to line this up with executable bit
EXE001, EXE002,
# these ignores are from flake8-bugbear; please fix!
B007,B008,
B007,B008,B905
# these ignores are from flake8-comprehensions; please fix!
C400,C401,C402,C403,C404,C405,C407,C411,C413,C414,C415
exclude = compute-wer.py,kaldi_io.py,__torch__,docs/conf.py
4 changes: 2 additions & 2 deletions wenet/bin/export_onnx_bpu.py
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@ def forward(self, x: torch.Tensor) -> torch.Tensor:
x = self.conv(x) # (1, odim, freq, time')
x_out = torch.zeros(x.size(0), self.odim, 1, x.size(3))
x = torch.split(x, self.split_size, dim=2)
for idx, (x_part, layer) in enumerate(zip(x, self.linear, strict=True)):
for idx, (x_part, layer) in enumerate(zip(x, self.linear)):
x_out += layer(x_part)
return x_out

Expand Down Expand Up @@ -792,7 +792,7 @@ def __init__(self, module):
self.split_size.append(out_channel)
orig_weight = torch.split(module.ctc_lo.weight, self.split_size, dim=0)
orig_bias = torch.split(module.ctc_lo.bias, self.split_size, dim=0)
for i, (w, b) in enumerate(zip(orig_weight, orig_bias, strict=True)):
for i, (w, b) in enumerate(zip(orig_weight, orig_bias)):
w = w.unsqueeze(2).unsqueeze(3)
self.ctc_lo[i].weight = torch.nn.Parameter(w)
self.ctc_lo[i].bias = torch.nn.Parameter(b)
Expand Down