mindspore.dataset.config.set_enable_shared_mem
- mindspore.dataset.config.set_enable_shared_mem(enable)
Set the default state of shared memory flag. If set to
True
, will use shared memory queues to pass data to processes that are created for operations that set python_multiprocessing toTrue
. It is enabled by default.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 is
True
.- Raises
TypeError – If enable is not a boolean data type.
Examples
>>> # Enable shared memory feature to improve the performance of Python multiprocessing. >>> import mindspore.dataset as ds >>> ds.config.set_enable_shared_mem(True)