title: Is there a handy way to dump the running_stats for a pytorch model?
body: <p>I'm writing a C version of the pytorch model to run it on my special hardware.
  Everything looks ok so far, except the running_mean and running_var in every batchnorm layer.</p>
  
  <p>We have a python code to dump all named_parameters, but nothing to do for the running_stats, although we need to use it in the forwarding computation.</p>
  
  <p>So is there a way to dump it with sort of built-in features?
  I searched pytorch doc, no help on my task.
  Otherwise I might need to write a regexp code to recognize and dump them.</p>
  
  <p>Thanks a lot.
  /Patrick</p>
  
  <pre class="lang-py prettyprint-override"><code>for name, param in model.named_parameters():
      # here can dump weight and bias, but not running_stats
      names.append(name)
      shapes.append(list(param.data.numpy().shape))
      values.append(param.data.numpy().flatten().tolist())
  </code></pre>