MCPcopy
hub / github.com/lutzroeder/netron / findNamedType

Method findNamedType

source/python.js:13702–13715  ·  view source on GitHub ↗
(name)

Source from the content-addressed store, hash-verified

13700 }
13701 }
13702 findNamedType(name) {
13703 const custom_class = torch._C.getCustomClass(name.qualifiedName());
13704 if (custom_class) {
13705 return custom_class;
13706 }
13707 this.parseSourceIfNeeded(name.prefix());
13708 const key = name.qualifiedName();
13709 const it = this._to_be_defined.get(key);
13710 if (it && it instanceof ast.ClassDef) {
13711 this._to_be_defined.delete(key);
13712 this.importNamedType(name.prefix(), it);
13713 }
13714 return this._cu.get_type(name);
13715 }
13716 importNamedType(qualifier, class_def) {
13717 const qualified_name = new torch._C.QualifiedName(`${qualifier}.${class_def.name}`);
13718 if (class_def.bases.length === 0) {

Callers 2

resolveTypeMethod · 0.80
attrMethod · 0.80

Calls 7

parseSourceIfNeededMethod · 0.80
importNamedTypeMethod · 0.80
get_typeMethod · 0.80
qualifiedNameMethod · 0.45
prefixMethod · 0.45
getMethod · 0.45
deleteMethod · 0.45

Tested by

no test coverage detected