def _load_model(self,directory,strict_loading=True,**kwargs):
        print('Loading pretrained weights')
        if isinstance(directory,dict):
            state_dict = directory
        else:           
            state_dict = torch.load(directory, map_location=lambda storage, loc: storage)
        new_state_dict = OrderedDict()
        
        for k, v in state_dict.items():
            if k[:7] == 'module.':
                name = k[7:] # remove `module.`
            else:
                name = k
            new_state_dict[name] = v
        self.model.load_state_dict(new_state_dict,strict=strict_loading) 

My loading function 
But in short you have something called
model.load_state_dict(your_weights)