Skip to content

Commit

Permalink
Fix some missing docstrings for Numpy functions. (#1768)
Browse files Browse the repository at this point in the history
  • Loading branch information
hawkinsp committed Nov 26, 2019
1 parent 2867e4b commit fbc9446
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions jax/numpy/lax_numpy.py
Expand Up @@ -256,6 +256,8 @@ def update_numpydoc(docstr, fun, op):

#Some numpy functions have an extra tab at the beginning of each line,
#If this function is one of those we remove this extra tab from all the lines
if not hasattr(op, '__code__'):
return docstr
if docstr[:4] == ' ':
lines = docstr.split('\n')
for idx, line in enumerate(lines):
Expand Down Expand Up @@ -289,6 +291,8 @@ def _wraps(fun, update_doc=True, lax_description=""):
If False, include the numpy docstring verbatim.
"""
def wrap(op):
if not hasattr(fun, '__doc__') or fun.__doc__ is None:
return op
try:
# Numpy doc comments have the form:
# fn(x, y, z) (optional)
Expand Down

0 comments on commit fbc9446

Please sign in to comment.