chainer.testing.save_and_load

chainer.testing.save_and_load(src, dst, filename, saver, loader)[source]

Saves src and loads it to dst using a de/serializer.

This function simply runs a serialization and deserialization to check if the serialization code is correctly implemented. The save and load are done within a temporary directory.

Parameters
  • src – An object to save from.

  • dst – An object to load into.

  • filename (str) – File name used during the save/load.

  • saver (callable) – Function that saves the source object.

  • loader (callable) – Function that loads the file into the destination object.