Skip to content

Instantly share code, notes, and snippets.

@szagoruyko
Created January 5, 2016 23:25
Show Gist options
  • Save szagoruyko/85bbf051dcf927f541b7 to your computer and use it in GitHub Desktop.
Save szagoruyko/85bbf051dcf927f541b7 to your computer and use it in GitHub Desktop.
-- Usage:
-- find . -name model.net -print0 | xargs -0 -n 1 th ~/clearState.lua
require 'cudnn'
local name = arg[1]
assert(paths.filep(name))
print'before'
os.execute('ls -alh '..name)
net = torch.load(name):clearState()
torch.save(name, net)
print'after'
os.execute('ls -alh '..name)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment