Commit e076f37c authored by krishnakalyan3's avatar krishnakalyan3 Committed by Facebook GitHub Bot
Browse files

Inplace initialisation of RNN weights (#2010)

Summary:
Ref: https://github.com/pytorch/audio/issues/1993

Pull Request resolved: https://github.com/pytorch/audio/pull/2010

Reviewed By: mthrok

Differential Revision: D32539511

Pulled By: nateanl

fbshipit-source-id: e99be963123cbc039d79bdb514450b7e8f5a84fc
parent b3830bac
...@@ -174,7 +174,7 @@ class UpsampleNetwork(nn.Module): ...@@ -174,7 +174,7 @@ class UpsampleNetwork(nn.Module):
kernel_size=(1, scale * 2 + 1), kernel_size=(1, scale * 2 + 1),
padding=(0, scale), padding=(0, scale),
bias=False) bias=False)
conv.weight.data.fill_(1. / (scale * 2 + 1)) torch.nn.init.constant_(conv.weight, 1. / (scale * 2 + 1))
up_layers.append(stretch) up_layers.append(stretch)
up_layers.append(conv) up_layers.append(conv)
self.upsample_layers = nn.Sequential(*up_layers) self.upsample_layers = nn.Sequential(*up_layers)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment