- load(fp: TextIO, cls: None = None, vartype: Optional[dimod.vartypes.Vartype] = None) dimod.binary.binary_quadratic_model.BinaryQuadraticModel ¶
Load a binary quadratic model from a COOrdinate-formatted file.
fp – File pointer to a file opened in read mode.
cls – Deprecated. Does nothing.
The valid variable types for binary quadratic models, is one of:
>>> from dimod.serialization import coo >>> with open('my_bqm.txt', 'r') as f: ... my_bqm = coo.load(f, vartype=dimod.Vartype.SPIN)
Deprecated since version 0.10.15: The
clskeyword will be removed in dimod 0.12.0. It currently does nothing.