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

Method deserialize_source

source/python.js:14026–14052  ·  view source on GitHub ↗
(iv)

Source from the content-addressed store, hash-verified

14024 return new torch._C.SourceRange(source, start, end);
14025 }
14026 deserialize_source(iv) {
14027 const tup = iv;
14028 if (this.cached_sources.has(tup)) {
14029 return this.cached_sources.get(tup);
14030 }
14031 let source = null;
14032 const tup_elems = tup;
14033 torch._C.TORCH_INTERNAL_ASSERT(tup_elems.length === 3);
14034 if (this._text_table.length > 0) {
14035 const [textIndex, fnameIndex, starting_line_no] = tup_elems;
14036 torch._C.TORCH_CHECK(fnameIndex < this._text_table.length);
14037 const filename = this._text_table[fnameIndex];
14038 const pieces = [];
14039 const strs = [];
14040 for (const i of textIndex) {
14041 pieces.push(this._text_table[i]);
14042 strs.push(this._text_table[i]);
14043 }
14044 // const str_cord = new torch._C.StringCordView(pieces, strs);
14045 source = new torch._C.Source(pieces.join(''), filename, starting_line_no);
14046 } else {
14047 const [text, filename, starting_line_no] = tup_elems;
14048 source = new torch._C.Source(text, filename, starting_line_no);
14049 }
14050 this.cached_sources.set(tup, source);
14051 return source;
14052 }
14053 });
14054 this.registerType('torch._C.SourceRangeUnpickler', class {
14055 });

Callers 1

deserializeMethod · 0.80

Calls 4

hasMethod · 0.45
getMethod · 0.45
pushMethod · 0.45
setMethod · 0.45

Tested by

no test coverage detected