Skip to content

Commit fca09ef

Browse files
committed
add example to is_patched
1 parent 747aaed commit fca09ef

1 file changed

Lines changed: 17 additions & 1 deletion

File tree

mkl_umath/src/_patch_numpy.pyx

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -328,7 +328,23 @@ def restore():
328328

329329

330330
def is_patched():
331-
"""Return True if NumPy umath loops have been patched by mkl_umath."""
331+
"""
332+
Return True if NumPy umath loops have been patched by mkl_umath.
333+
334+
Examples
335+
--------
336+
>>> import mkl_umath
337+
>>> mkl_umath.is_patched()
338+
# False
339+
340+
>>> mkl_umath.patch_numpy_umath() # Enable mkl_umath in Numpy
341+
>>> mkl_umath.is_patched()
342+
# True
343+
344+
>>> mkl_umath.restore_numpy_umath() # Disable mkl_umath in Numpy
345+
>>> mkl_umath.is_patched()
346+
# False
347+
"""
332348
return _patch.is_patched()
333349

334350

0 commit comments

Comments
 (0)