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

Method _set_from_file

source/python.js:20925–20934  ·  view source on GitHub ↗
(unpickler)

Source from the content-addressed store, hash-verified

20923 this._cdata = data;
20924 }
20925 _set_from_file(unpickler) {
20926 const buffer = unpickler.read(8);
20927 const size = buffer.reverse().reduce((a, b) => (a * 256) + b, 0);
20928 if (size !== this.size()) {
20929 throw new python.Error('Typed storage size mismatch.');
20930 }
20931 const itemsize = this.dtype.itemsize();
20932 const data = unpickler.stream(itemsize * size);
20933 this._set_cdata(data);
20934 }
20935 static _new_with_file(unpickler) {
20936 const buffer = unpickler.read(8);
20937 const size = buffer.reverse().reduce((a, b) => (a * 256) + b, 0);

Callers 1

_legacy_loadMethod · 0.80

Calls 5

itemsizeMethod · 0.80
_set_cdataMethod · 0.80
readMethod · 0.45
sizeMethod · 0.45
streamMethod · 0.45

Tested by

no test coverage detected