fix aishell3-vc0

pull/3928/head
liyulingyue 10 months ago
parent 67ae7c8dd2
commit 62bac0a1d1

@ -171,7 +171,9 @@ class AttLoc(nn.Layer):
if paddle.sum(att_prev) == 0: if paddle.sum(att_prev) == 0:
# if no bias, 0 0-pad goes 0 # if no bias, 0 0-pad goes 0
att_prev = 1.0 - make_pad_mask(enc_hs_len) att_prev = 1.0 - make_pad_mask(enc_hs_len)
att_prev = att_prev / enc_hs_len.unsqueeze(-1) unsqueeze_enc_hs_len = enc_hs_len.unsqueeze(-1).astype(
att_prev.dtype)
att_prev = att_prev / unsqueeze_enc_hs_len
# att_prev: (utt, frame) -> (utt, 1, 1, frame) # att_prev: (utt, frame) -> (utt, 1, 1, frame)
# -> (utt, att_conv_chans, 1, frame) # -> (utt, att_conv_chans, 1, frame)

@ -162,6 +162,8 @@ class Encoder(nn.Layer):
return xs.transpose([0, 2, 1]) return xs.transpose([0, 2, 1])
if not isinstance(ilens, paddle.Tensor): if not isinstance(ilens, paddle.Tensor):
ilens = paddle.to_tensor(ilens) ilens = paddle.to_tensor(ilens)
if ilens.ndim == 0:
ilens = ilens.unsqueeze(0)
xs = xs.transpose([0, 2, 1]) xs = xs.transpose([0, 2, 1])
# for dygraph to static graph # for dygraph to static graph
# self.blstm.flatten_parameters() # self.blstm.flatten_parameters()

Loading…
Cancel
Save