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

Method parseModule

source/python.js:18916–18936  ·  view source on GitHub ↗
(module)

Source from the content-addressed store, hash-verified

18914 this._ivalue_parsers.set(torch.mobile.serialization.Object, (ivalue) => this.parseObject(ivalue));
18915 }
18916 parseModule(module) {
18917 this._module = module;
18918 this._all_functions = new Map();
18919 this._all_ivalues = new Array(module.ivalues.length);
18920 this._all_types = new Array(module.object_types.length);
18921 const mobile_ivalue_size = module.mobile_ivalue_size ? module.mobile_ivalue_size : module.ivalues.length;
18922 for (let i = 0; i < mobile_ivalue_size; i++) {
18923 this.parseAndPopulate(i, module.ivalues[i]);
18924 }
18925 const m = this._all_ivalues[module.state_obj];
18926 for (const [name, value] of this._all_functions) {
18927 const class_index = module.ivalues[name].val.class_type;
18928 const class_type = this._all_types[class_index];
18929 if (value) {
18930 class_type.addMethod(value);
18931 }
18932 }
18933 m._min_operator_version = module.operator_version;
18934 m._bytecode_version = module.bytecode_version;
18935 return m;
18936 }
18937 parseAndPopulate(i, ivalue) {
18938 if (ivalue.val instanceof torch.mobile.serialization.Function) {
18939 this._all_functions.set(i, this.parseFunction(ivalue.val));

Callers 1

constructorMethod · 0.80

Calls 2

parseAndPopulateMethod · 0.80
addMethodMethod · 0.80

Tested by

no test coverage detected