onnx_chainer.replace_func.as_funcnode(name, rename_attributes=None)

The target function fakes FunctionNode

The target function is overwrapped to connect variable node by acting function node. Expected to be used as decorator. More detail, see fake_as_funcnode documentation.


>>> @onnx_chainer.replace_func.as_funcnode(
...     'CustomNode', rename_attributes=[(1, 'value'), ('c', 'y')])
... def func(x, a, b, c=1, d=2): pass
  • name (str) – function name. This name is used for what ONNX operator to be assigned.

  • rename_attributes (list or tuple) – rename attribute name, set list of tuple(index_of_args, new_name) or tuple(kwargs_name, new_name)