Skip to main content

Python function

msgpack_numpy_encoder

msgpack_numpy_encoder()โ€‹

max.interfaces.msgpack_numpy_encoder(use_shared_memory=False, shared_memory_threshold=24000000)

source

Create an encoder function that handles numpy arrays.

Parameters:

  • use_shared_memory (bool) โ€“ Whether to attempt shared memory conversion for numpy arrays
  • shared_memory_threshold (int) โ€“ Minimum size in bytes for shared memory conversion. If 0, all arrays are candidates for conversion.

Returns:

A pickleable encoder instance that encodes objects into bytes

Return type:

MsgpackNumpyEncoder