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")
| 330 | |
| 331 | |
| 332 | def _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 | |
| 347 | Args |
| 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 | |
| 358 | def _docstring_generator_call(op_name, api="ops", args=None): |
no test coverage detected