@parse_args

@parse_args is used to specify the type of variables in the function,

@parse_args('v') #说明不改变x的类型,如果x是tensor就还是tensor
def custom_sigmoid_onnx(g, x):
@parse_args('i') #说明x是int类型的数据
def custom_sigmoid_onnx(g, x):
@parse_args('i',‘f’) #说明x是int类型的数据,y是float类型的数据
def custom_sigmoid_onnx(g, x,y):

If you look at the source code, the most important thing is the function _parse_arg.

おすすめ

転載: blog.csdn.net/weixin_44594953/article/details/127972705