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

Method __float__

source/python.js:21290–21300  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

21288 return NaN;
21289 }
21290 __float__() {
21291 const storage = this.storage();
21292 if (storage && storage.dtype.__reduce__() === 'float32') {
21293 if (storage.size() !== undefined && storage.data.length === 4) {
21294 const buffer = storage.data.peek ? storage.data.peek() : storage.data;
21295 const view = new DataView(buffer.buffer, buffer.byteOffset, buffer.byteLength);
21296 return view.getFloat32(0, true);
21297 }
21298 }
21299 return NaN;
21300 }
21301 tolist() {
21302 const storage = this.storage();
21303 const dtype = storage.dtype.__reduce__();

Callers 1

constructorMethod · 0.80

Calls 4

__reduce__Method · 0.80
storageMethod · 0.45
sizeMethod · 0.45
peekMethod · 0.45

Tested by

no test coverage detected