Hi, saving a
nn.Module seems obscure, but by digging the code I can tell it should look like:
But how to clean/clear all the
.grad fields of each
Parameter (which is derived from
Variable) before the saving, in case I just want a minimum net for inference next time? A user may want something like the shorthand
net:clearState() in Torch 7.