rwth-i6 / pytorch-to-returnn

Make PyTorch code runnable within RETURNN
3 stars 6 forks source link

fix and extend tensor initializers #14

Closed vieting closed 3 years ago

vieting commented 3 years ago

Add kaiming_normal_ and constant_.

Also, torch.Tensor.uniform_() and related should have a return value, e.g. I encountered a statement self.mask_emb = nn.Parameter(torch.FloatTensor(args.encoder_embed_dim).uniform_()) which does not work if there is no return value.