MCPcopy Create free account
hub / github.com/NVIDIA/DALI / _docstring_prefix_auto

Function _docstring_prefix_auto

dali/python/nvidia/dali/ops/_docs.py:332–355  ·  view source on GitHub ↗

Generate start of the docstring for `__call__` of Operator `op_name` with default values. Assumes there will be 0 or 1 inputs

(op_name, api="fn")

Source from the content-addressed store, hash-verified

330
331
332def _docstring_prefix_auto(op_name, api="fn"):
333 """
334 Generate start of the docstring for `__call__` of Operator `op_name`
335 with default values. Assumes there will be 0 or 1 inputs
336 """
337 schema = _b.GetSchema(op_name)
338 if schema.MaxNumInput() == 0:
339 return f"""
340{_call_description(api)}. This operator doesn't have any inputs.
341"""
342 elif schema.MaxNumInput() == 1:
343 input_name = _names._get_input_name(schema, 0)
344 ret = f"""
345{_call_description(api)}.
346
347Args
348----
349"""
350 dox = "Input to the operator.\n"
351 input_type = _input_type(api)
352 fmt = input_type + _supported_layouts_str(schema.GetSupportedLayouts(0))
353 ret += _numpydoc_formatter(input_name, fmt, dox, optional=False)
354 return ret
355 return ""
356
357
358def _docstring_generator_call(op_name, api="ops", args=None):

Callers 1

Calls 5

_call_descriptionFunction · 0.85
_input_typeFunction · 0.85
_supported_layouts_strFunction · 0.85
_numpydoc_formatterFunction · 0.85
MaxNumInputMethod · 0.80

Tested by

no test coverage detected