How to get/set model's weight (delta) in torch?
<p>Sorry for asking as a newbie to torch, but I promise to have search a lot through the documents and Internet.</p>

<p>There are two main demands I need,
the first one is to get the weight delta after training for one or more batches,
the second one is to set the new weight to model.</p>

<p>That means I want to update the weights by my own methods (with external library),
will it be possible to achieve that in torch?</p>

<p>It seems that torch has an abstract <code>module</code> class [1] but its interface doesn't fit all my needs.</p>

<p>[1] <a href="https://github.com/torch/nn/blob/master/doc/module.md#nn.Module" rel="nofollow">https://github.com/torch/nn/blob/master/doc/module.md#nn.Module</a></p>