'Saves the optimizer (updater) state to a file. This is often used when checkpointing
the model during training.
Parameters
fname : str
Path to the output states file.'

def save_optimizer_states(self, fname):

    assert (self._updater is not None), 'Cannot    save    states    for    distributed    training'
    with open(fname, 'wb') as fout:
        fout.write(self._updater.get_states())
