一 函数入口
def pointwise_dynamic(f: Optional[JITFunction] = None,*,num_inputs: Optional[int] = None,is_tensor: Optional[List[bool]] = None,dtypes: Optional[List[Optional[type]]] = None,num_outputs: Optional[int] = None,output_dtypes: Optional[List[type]] = None,
):def decorator(fn):nonlocal num_inputsif (num_inputs is None) and (is_tensor is None) and (dtypes is None):num_inputs = len(fn.arg_names)op_desc = OPDesc(num_inputs=num_inputs,is_tensor=is_tensor,dtypes=dtypes,num_outputs=num_outputs,output_dtypes=output_dtypes,)return PointwiseDynamicFunction(op_desc, fn)if f is not None:return decorator(f)return decorator
1 其中Optional表示输入参数为可选项,可以为指定的类型,或者为None,默认是None
2 nonl