class_docstr: Trainer extension to take snapshots.
  
  This extension serializes the given object and saves it to the output
  directory.
  
  This extension is called once per epoch by default. To take a
  snapshot at a different interval, a trigger object specifying the
  required interval can be passed along with this extension
  to the `extend()` method of the trainer.
  
  The default priority is -100, which is lower than that of most
  built-in extensions.
class_docstr_tok: ["Trainer","extension","to","take","snapshots",".","This","extension","serializes","the","given","object","and","saves","it","to","the","output","directory",".","This","extension","is","called","once","per","epoch","by","default",".","To","take","a","snapshot","at","a","different","interval",",","a","trigger","object","specifying","the","required","interval","can","be","passed","along","with","this","extension","to","the","`","extend","(",")","`","method","of","the","trainer",".","The","default","priority","is","-100",",","which","is","lower","than","that","of","most","built-in","extensions","."]
code: def on_error(self, trainer, exc, tb):
      super(_Snapshot, self).on_error(trainer, exc, tb)
      if self._snapshot_on_error:
          self._make_snapshot(trainer)
  
imports: import os
  import warnings
  import chainer
  from chainer.serializers import npz
  from chainer.training import extension
  from chainer.training.extensions import snapshot_writers
  from chainer.utils import argument
label_desc: Use image node_id 3 for calling the _Snapshot obj's underlying member method code with example usage: obj.on_error(trainer, exc, tb) without return types