dwave.optimization.model.Model.into_file#

Model.into_file(file, *, max_num_states=0, only_decision=False)#

Serialize the model into an existing file.

Parameters:
  • file – File pointer to an existing writeable, seekable file-like object encoding a model. Strings are interpreted as a file name.

  • max_num_states – Maximum number of states to serialize along with the model. The number of states serialized is min(model.states.size(), max_num_states).

  • only_decision – If True, only decision variables are serialized. If False, all symbols are serialized.

TODO: describe the format