| 13909 | this._cu.define(new torch._C.QualifiedName(qualifier), /*properties=*/[], /*propResolvers=*/[], definitions, resolvers, null); |
| 13910 | } |
| 13911 | parseSourceIfNeeded(qualifier) { |
| 13912 | if (!qualifier || this._loaded_sources.has(qualifier)) { |
| 13913 | return; |
| 13914 | } |
| 13915 | this._loaded_sources.add(qualifier); |
| 13916 | const src = this._source_loader(qualifier); |
| 13917 | if (!src) { |
| 13918 | return; |
| 13919 | } |
| 13920 | this._sources.set(src.filename(), src); |
| 13921 | const p = new torch._C.Parser(src); |
| 13922 | const L = p.parse(); |
| 13923 | this.parsePossibleVersionNumber(p); |
| 13924 | for (const stmt of L.body) { |
| 13925 | if (stmt instanceof ast.ClassDef) { |
| 13926 | const name = `${qualifier}.${stmt.name}`; |
| 13927 | this._to_be_defined.set(name, stmt); |
| 13928 | } else if (stmt instanceof ast.FunctionDef) { |
| 13929 | const name = `${qualifier}.${stmt.name}`; |
| 13930 | this._to_be_defined.set(name, stmt); |
| 13931 | } |
| 13932 | } |
| 13933 | } |
| 13934 | parsePossibleVersionNumber(/* p */) { |
| 13935 | } |
| 13936 | parseImports(/* p */) { |