pytorch_pfn_extras.training.extensions.snapshot_writers.ProcessWriter#
- class pytorch_pfn_extras.training.extensions.snapshot_writers.ProcessWriter(savefun=<function save>, fs=None, out_dir='', **kwds)#
Bases:
StandardWriter[Process]Snapshot writer that uses a separate process.
This class creates a new process that invokes the actual saving function.
Note
Forking a new process from a MPI process might be danger. Consider using
ThreadWriterinstead ofProcessWriterif you are using MPI.Methods
__init__([savefun, fs, out_dir])create_worker(filename, out_dir, target, *)Creates a worker for the snapshot.
finalize()Finalizes the writer.
initialize(out_dir)save(filename, out_dir, target, savefun, ...)- __init__(savefun=<function save>, fs=None, out_dir='', **kwds)#
- create_worker(filename, out_dir, target, *, savefun=None, append=False, **savefun_kwargs)#
Creates a worker for the snapshot.
This method creates a thread or a process to take a snapshot. The created worker must have
start()andjoin()methods. If the worker has anexitcodeattribute (e.g.,multiprocessing.Process), the value will be tested.