mindspore.dataset.config.set_enable_shared_mem

mindspore.dataset.config.set_enable_shared_mem(enable)

Set the default state of shared memory flag. If shared_mem_enable is True, will use shared memory queues to pass data to processes that are created for operations that set python_multiprocessing=True.

Note

set_enable_shared_mem is not supported on Windows and MacOS platforms yet.

Parameters

enable (bool) – Whether to use shared memory in operations when python_multiprocessing=True.

Raises

TypeError – If enable is not a boolean data type.

Examples

>>> # Enable shared memory feature to improve the performance of Python multiprocessing.
>>> ds.config.set_enable_shared_mem(True)