Skip to content

Commit

Permalink
Update i6_models/parts/frontend/generic_frontend.py
Browse files Browse the repository at this point in the history
Co-authored-by: SimBe195 <[email protected]>
  • Loading branch information
Judyxujj and SimBe195 authored Nov 10, 2023
1 parent 84fcb74 commit dde2533
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions i6_models/parts/frontend/generic_frontend.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,14 +85,9 @@ def check_valid(self):

assert len(self.layer_ordering) == num_convs + num_pools + num_activations, "Number of total layers mismatch!"

for kernel_sizes in [self.conv_kernel_sizes, self.pool_kernel_sizes]:
if kernel_sizes is not None:
for kernel_size in kernel_sizes:
if isinstance(kernel_size, int):
assert kernel_size % 2 == 1, "ConformerVGGFrontendV1 only supports odd kernel sizes"
elif isinstance(kernel_size, tuple):
for i in range(len(kernel_size)):
assert kernel_size[i] % 2 == 1, "ConformerVGGFrontendV1 only supports odd kernel sizes"
for kernel_sizes in filter(None, [self.conv_kernel_sizes, self.pool_kernel_sizes]):
for kernel_size in kernel_sizes:
assert all(k % 2 for k in kernel_size), "ConformerVGGFrontendV1 only supports odd kernel sizes"

def __post__init__(self):
super().__post_init__()
Expand Down

0 comments on commit dde2533

Please sign in to comment.