dimod.serialization.fileview.load

load(fp, cls=None)[source]

Load a binary quadratic model from a file.

Parameters:
  • fp (bytes-like/file-like) – If file-like, should be readable, seekable file-like object. If bytes-like it will be wrapped with io.BytesIO.
  • cls (class, optional) – The class of binary quadratic model. If not provided, the bqm will be of the same class that was saved. Note: currently only works for AdjArrayBQM.
Returns:

The loaded bqm.