Exemplo n.º 1
0
    def forward(self, model):
        try:
            func = torch.nn.init.orthogonal_
        except AttributeError:
            func = torch.nn.init.orthogonal

        nninit_base.apply_initializer(model, func, self.__dict__)
Exemplo n.º 2
0
 def forward(self, model):
     try:
         func = torch.nn.init.kaiming_uniform_
     except AttributeError:
         func = torch.nn.init.kaiming_uniform
     nninit_base.apply_initializer(model, func, self.__dict__)