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

Method LEGACY_import_methods

source/python.js:13970–13986  ·  view source on GitHub ↗
(mod, src)

Source from the content-addressed store, hash-verified

13968 return null;
13969 }
13970 LEGACY_import_methods(mod, src) {
13971 const self = new torch._C.SimpleSelf(mod.type());
13972 const prefix = mod.type().name();
13973 const p = new torch._C.Parser(src);
13974 const L = p.parse();
13975 this.parsePossibleVersionNumber(L);
13976 this.parseImports(L);
13977 const definitions = [];
13978 const resolvers = [];
13979 for (const def of L.body) {
13980 if (def instanceof ast.FunctionDef) {
13981 definitions.push(def);
13982 resolvers.push(this);
13983 }
13984 }
13985 this._cu.define(prefix, /*properties=*/[], /*propResolvers=*/[], definitions, resolvers, self);
13986 }
13987 findFunction(name) {
13988 this.parseSourceIfNeeded(name.prefix());
13989 const key = name.qualifiedName();

Callers 1

LEGACY_convertModuleMethod · 0.80

Calls 7

parseImportsMethod · 0.80
defineMethod · 0.80
typeMethod · 0.45
nameMethod · 0.45
parseMethod · 0.45
pushMethod · 0.45

Tested by

no test coverage detected