MCPcopy Create free account
hub / github.com/pytorch/pytorch / ModelSizeSection

Function ModelSizeSection

torch/utils/model_dump/code.js:69–90  ·  view source on GitHub ↗
({model: {file_size, zip_files}})

Source from the content-addressed store, hash-verified

67}
68
69function ModelSizeSection({model: {file_size, zip_files}}) {
70 let store_size = 0;
71 let compr_size = 0;
72 for (const zi of zip_files) {
73 if (zi.compression === 0) {
74 // TODO: Maybe check that compressed_size === file_size.
75 store_size += zi.compressed_size;
76 } else {
77 compr_size += zi.compressed_size;
78 }
79 }
80 let zip_overhead = file_size - store_size - compr_size;
81 // TODO: Better formatting. Right-align this.
82 return html`
83 <${Hider} name="Model Size" shown=true>
84 <pre>.
85 Model size: ${file_size} (${humanFileSize(file_size)})
86 Stored files: ${store_size} (${humanFileSize(store_size)})
87 Compressed files: ${compr_size} (${humanFileSize(compr_size)})
88 Zip overhead: ${zip_overhead} (${humanFileSize(zip_overhead)})
89 </pre><//>`;
90}
91
92function StructuredDataSection({name, data, shown}) {
93 return html`

Callers

nothing calls this directly

Calls 1

humanFileSizeFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…