We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I'm wondering where i can find the standard code to remove the gradBias and gradWeight and generate a unpack function to recover the model.
The text was updated successfully, but these errors were encountered:
for k,v in ipairs(net:listModules()) do v.gradWeight = nil v.gradBias = nil end local ts = { model = net:float(), unpack = function(self) for k,v in ipairs(self.model:listModules()) do if v.weight and not v.gradWeight then v.gradWeight = v.weight:clone() v.gradBias = v.bias:clone() end end return self.model end } torch.save('model.t7', ts)
Sorry, something went wrong.
Thank you
No branches or pull requests
I'm wondering where i can find the standard code to remove the gradBias and gradWeight and generate a unpack function to recover the model.
The text was updated successfully, but these errors were encountered: