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

Method unpickle

source/python.js:14063–14084  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

14061 this.unpickled_records = null;
14062 }
14063 unpickle() {
14064 if (this.unpickled_records) {
14065 return;
14066 }
14067 const unpickler = new pickle.Unpickler(this.data);
14068 const ivalues = unpickler.load();
14069 torch._C.TORCH_CHECK(ivalues.length > 0);
14070 this.unpickled_records = [];
14071 let lines = null;
14072 if (ivalues[0] === 'FORMAT_WITH_STRING_TABLE') {
14073 this.deserializer = new torch._C.SourceRangeDeserializer(ivalues[1]);
14074 lines = ivalues[2];
14075 } else {
14076 this.deserializer = new torch._C.SourceRangeDeserializer();
14077 lines = ivalues;
14078 }
14079 for (const tup_elems of lines) {
14080 const [offset, range] = tup_elems;
14081 const source_range = this.deserializer.deserialize(range);
14082 this.unpickled_records.push([offset, source_range]);
14083 }
14084 }
14085 findSourceRangeThatGenerated(range) {
14086 this.unpickle();
14087 const start = range.start();

Callers 1

Calls 3

loadMethod · 0.45
deserializeMethod · 0.45
pushMethod · 0.45

Tested by

no test coverage detected