mygrad.mem_guard_off#

mygrad.mem_guard_off = <mygrad._utils.lock_management._NoMemGuard object>#

A context manager used to suspend memory-locking behavior

Examples

>>> from mygrad import  mem_guard_off
>>> with mem_guard_off:
...     # array-memory locking is turned off
...     pass
... # previous memory-locking behavior is restored

This can also be used as a decorator

>>> @mem_guard_off
>>> def f():
...     # array-memory locking is turned off within function
...     return