Skip to content

Commit

Permalink
fix lint error
Browse files Browse the repository at this point in the history
  • Loading branch information
czy97 committed Sep 3, 2024
1 parent 3f08e2d commit 10868f6
Show file tree
Hide file tree
Showing 8 changed files with 156 additions and 121 deletions.
4 changes: 2 additions & 2 deletions wespeaker/models/campplus.py
Original file line number Diff line number Diff line change
Expand Up @@ -396,15 +396,15 @@ def __init__(self,
nn.init.zeros_(m.bias)

def get_frame_level_feat(self, x):
# for outer interface
# for outer interface
x = x.permute(0, 2, 1) # (B,T,F) => (B,F,T)
x = self.head(x)
for layer in self.xvector[:-2]:
x = layer(x)

out = x.permute(0, 2, 1)

return out # (B, T, D)
return out # (B, T, D)

def forward(self, x):
x = x.permute(0, 2, 1) # (B,T,F) => (B,F,T)
Expand Down
4 changes: 2 additions & 2 deletions wespeaker/models/ecapa_tdnn.py
Original file line number Diff line number Diff line change
Expand Up @@ -220,9 +220,9 @@ def __get_frame_level_feat(self, x):
return out

def get_frame_level_feat(self, x):
# for outer interface
# for outer interface
out = self.__get_frame_level_feat(x).permute(0, 2, 1)
return out # (B, T, D)
return out # (B, T, D)

def forward(self, x):
out = F.relu(self.__get_frame_level_feat(x))
Expand Down
5 changes: 3 additions & 2 deletions wespeaker/models/eres2net.py
Original file line number Diff line number Diff line change
Expand Up @@ -350,6 +350,7 @@ def _make_layer(self,
expansion))
self.in_planes = planes * self.expansion
return nn.Sequential(*layers)

def __get_frame_level_feat(self, x):
# for inner class usage
x = x.permute(0, 2, 1) # (B,T,F) => (B,F,T)
Expand All @@ -369,12 +370,12 @@ def __get_frame_level_feat(self, x):
return fuse_out1234

def get_frame_level_feat(self, x):
# for outer interface
# for outer interface
out = self.__get_frame_level_feat(x)
out = out.transpose(1, 3)
out = torch.flatten(out, 2, -1)

return out # (B, T, D)
return out # (B, T, D)

def forward(self, x):
fuse_out1234 = self.__get_frame_level_feat(x)
Expand Down
Loading

0 comments on commit 10868f6

Please sign in to comment.