-
-
Save arunm8489/d936ccc3708b134aa059bc6f08d16fa2 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
else: | |
#Number of biases | |
num_biases = conv.bias.numel() | |
#Load the weights | |
conv_biases = torch.from_numpy(weights[ptr: ptr + num_biases]) | |
ptr = ptr + num_biases | |
#reshape the loaded weights according to the dims of the model weights | |
conv_biases = conv_biases.view_as(conv.bias.data) | |
#Finally copy the data | |
conv.bias.data.copy_(conv_biases) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment