MCPcopy Create free account
hub / github.com/bitsandbytes-foundation/bitsandbytes / torch_save_to_buffer

Function torch_save_to_buffer

tests/helpers.py:53–57  ·  view source on GitHub ↗
(obj)

Source from the content-addressed store, hash-verified

51
52
53def torch_save_to_buffer(obj):
54 buffer = BytesIO()
55 torch.save(obj, buffer)
56 buffer.seek(0)
57 return buffer
58
59
60def torch_load_from_buffer(buffer):

Callers 2

Calls

no outgoing calls

Tested by 2