class<function save_npz>, task=None)[source]

Base class of queue snapshot writers.

This class is a base class of snapshot writers that use a queue. A Queue is created when this class is constructed, and every time when __call__ is invoked, a snapshot task is put into the queue.

  • savefun – Callable object which is passed to the create_task() if the task is None. It takes three arguments: the output file path, the serialized dictionary object, and the optional keyword arguments.

  • task – Callable object. Its __call__ must have a same interface to Writer.__call__. This object is directly put into the queue.


__call__(filename, outdir, target)[source]

Invokes the actual snapshot function.

This method is invoked by a Snapshot object every time it takes a snapshot.

  • filename (str) – Name of the file into which the serialized target is saved. It is a concrete file name, i.e. not a pre-formatted template string.

  • outdir (str) – Output directory. Corresponds to Trainer.out.

  • target (dict) – Serialized object which will be saved.


Finalizes the wirter.

Like extensions in Trainer, this method is invoked at the end of the training.

save(filename, outdir, target, savefun, **kwds)[source]
__eq__(value, /)

Return self==value.

__ne__(value, /)

Return self!=value.

__lt__(value, /)

Return self<value.

__le__(value, /)

Return self<=value.

__gt__(value, /)

Return self>value.

__ge__(value, /)

Return self>=value.