mirror of
https://github.com/modelscope/FunASR.git
synced 2026-10-12 02:19:18 +00:00
数据并行可能导致的模型训练报错 (#2139)
* fix: 修复数据并行训练中ä¼可能会出现的错误 * fix: 修复数据并行训练中ä¼可能会出现的错误 * fix: 修复数据并行ènot need tensor --------- Co-authored-by: zhaochaojin <[email protected]>
This commit is contained in:
co-authored by
zhaochaojin
parent
5c28b4d612
commit
70645e4807
@@ -555,7 +555,8 @@ class SenseVoiceEncoderSmall(nn.Module):
|
||||
ilens: torch.Tensor,
|
||||
):
|
||||
"""Embed positions in tensor."""
|
||||
masks = sequence_mask(ilens, device=ilens.device)[:, None, :]
|
||||
maxlen = xs_pad.shape[1]
|
||||
masks = sequence_mask(ilens, maxlen = maxlen, device=ilens.device)[:, None, :]
|
||||
|
||||
xs_pad *= self.output_size() ** 0.5
|
||||
|
||||
|
||||
Reference in New Issue
Block a user