Skip to main content

Python class

SharedMemoryArray

SharedMemoryArray​

class max.interfaces.SharedMemoryArray(name, shape, dtype)

source

Bases: object

A wrapper for a NumPy array stored in shared memory.

This class is used as a placeholder in pixel_values during serialization. It will be encoded as a dict with __shm__ flag and decoded back to a NumPy array.

Parameters:

dtype​

dtype: str

source

The NumPy dtype string of the array (for example, <f4 for float32).

name​

name: str

source

The unique name of the shared memory segment.

shape​

shape: tuple[int, ...]

source

The shape of the NumPy array stored in shared memory.