Update decoder.py

This commit is contained in:
jinzr 2023-10-23 21:19:25 +08:00
parent eb67938c8c
commit c2bbb2dcbe

View File

@ -70,6 +70,10 @@ class Decoder(nn.Module):
groups=embedding_dim,
bias=False,
)
else:
# To avoid `RuntimeError: Module 'Decoder' has no attribute 'conv'`
# when inference with torch.jit.script and context_size == 1
self.conv = nn.Identity()
def forward(self, y: torch.Tensor, need_pad: bool = True) -> torch.Tensor:
"""