def METHOD_NAME(self, variational_state):
    if not self._save_params:
        return
    if variational_state is None:
        return
    _time = time.time()
    binary_data = serialization.to_bytes(variational_state.variables)
    with open(self._prefix + ".mpack", "wb") as outfile:
        outfile.write(binary_data)
    self._steps_notflushed_pars = 0
    self._flush_pars_time += time.time() - _time