MCPcopy Index your code
hub / github.com/lutzroeder/netron / parseArgsFromDecl

Method parseArgsFromDecl

source/python.js:11887–11904  ·  view source on GitHub ↗
(decl, skip_self)

Source from the content-addressed store, hash-verified

11885 return new torch.FunctionSchema(name, '', args, returns, false, false);
11886 }
11887 parseArgsFromDecl(decl, skip_self) {
11888 const retval = [];
11889 if (decl.args.posonlyargs.length > 0 || decl.args.kwonlyargs.length > 0) {
11890 throw new python.Error('Unsupported function argument.');
11891 }
11892 const params = decl.args.args.slice();
11893 const kwonlyargs = new Set(Array.from(decl.args.kwonlyargs));
11894 const start = skip_self ? 1 : 0;
11895 for (let i = start; i < params.length; i++) {
11896 const decl_arg = params[i];
11897 const N = null;
11898 const default_value = undefined;
11899 const type = decl_arg.annotation ? this.parseTypeFromExpr(decl_arg.annotation) : null;
11900 const arg = new torch.Argument(decl_arg.arg, type, type, N, default_value, kwonlyargs.has(decl_arg), null);
11901 retval.push(arg);
11902 }
11903 return retval;
11904 }
11905 parseReturnFromDecl(decl) {
11906 if (!decl.returns) {
11907 return [];

Callers 1

parseSchemaFromDefMethod · 0.80

Calls 3

parseTypeFromExprMethod · 0.80
hasMethod · 0.45
pushMethod · 0.45

Tested by

no test coverage detected