Configurable.save

Configurable.save(path, compile_model=False)[source]

Saves the module's configuration and parameters to files in the specified directory. It creates two files, namely config.json and parameters.pt which contain the configuration and parameters, respectively.

Parameters
  • path (Union[str, PathLike[str]]) -- The directory to which to save the configuration and parameter files. The directory may or may not exist but no parent directories are created.

  • compile_model (bool) -- Whether the model should be compiled via TorchScript. An additional file called model.ptc will then be stored. Note that you can simply load the compiled model via torch.jit.load() at a later point.

Return type

None