mirror of
https://github.com/k2-fsa/icefall.git
synced 2025-09-19 05:54:20 +00:00
small fixes
This commit is contained in:
parent
d5dcca674c
commit
c9055e03e3
@ -320,7 +320,7 @@ class AsrModel(nn.Module):
|
|||||||
assert x_lens.ndim == 1, x_lens.shape
|
assert x_lens.ndim == 1, x_lens.shape
|
||||||
assert y.num_axes == 2, y.num_axes
|
assert y.num_axes == 2, y.num_axes
|
||||||
|
|
||||||
assert x.size(0) == x_lens.size(0) == y.dim0
|
assert x.size(0) == x_lens.size(0) == y.dim0, (x.shape, x_lens.shape, y.dim0)
|
||||||
|
|
||||||
# Compute encoder outputs
|
# Compute encoder outputs
|
||||||
encoder_out, encoder_out_lens = self.forward_encoder(x, x_lens)
|
encoder_out, encoder_out_lens = self.forward_encoder(x, x_lens)
|
||||||
|
@ -219,7 +219,7 @@ class Zipformer2(EncoderInterface):
|
|||||||
|
|
||||||
(num_frames0, batch_size, _encoder_dims0) = x.shape
|
(num_frames0, batch_size, _encoder_dims0) = x.shape
|
||||||
|
|
||||||
assert self.encoder_dim[0] == _encoder_dims0
|
assert self.encoder_dim[0] == _encoder_dims0, (self.encoder_dim[0], _encoder_dims0)
|
||||||
|
|
||||||
feature_mask_dropout_prob = 0.125
|
feature_mask_dropout_prob = 0.125
|
||||||
|
|
||||||
@ -334,7 +334,7 @@ class Zipformer2(EncoderInterface):
|
|||||||
x = self._get_full_dim_output(outputs)
|
x = self._get_full_dim_output(outputs)
|
||||||
x = self.downsample_output(x)
|
x = self.downsample_output(x)
|
||||||
# class Downsample has this rounding behavior..
|
# class Downsample has this rounding behavior..
|
||||||
assert self.output_downsampling_factor == 2
|
assert self.output_downsampling_factor == 2, self.output_downsampling_factor
|
||||||
if torch.jit.is_scripting() or torch.jit.is_tracing():
|
if torch.jit.is_scripting() or torch.jit.is_tracing():
|
||||||
lengths = (x_lens + 1) // 2
|
lengths = (x_lens + 1) // 2
|
||||||
else:
|
else:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user