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

Method render

torch/utils/model_dump/code.js:553–575  ·  view source on GitHub ↗
({model: {model_data, constants}})

Source from the content-addressed store, hash-verified

551// Make this a separate component so it is rendered lazily.
552class OpenTensorMemorySection extends Component {
553 render({model: {model_data, constants}}) {
554 let sizes = getTensorMemoryByDevice(new Map([
555 ["data", model_data],
556 ["constants", constants],
557 ]));
558 return html`
559 <table>
560 <thead>
561 <tr>
562 <th>Device</th>
563 <th>Bytes</th>
564 <th>Human</th>
565 </tr>
566 </thead>
567 <tbody style="font-family:monospace;">
568 ${Object.entries(sizes).map(([dev, size]) => html`<tr>
569 <td>${dev}</td>
570 <td>${size}</td>
571 <td>${humanFileSize(size)}</td>
572 </tr>`)}
573 </tbody>
574 </table>`;
575 }
576}
577
578function TensorMemorySection({model}) {

Callers

nothing calls this directly

Calls 3

getTensorMemoryByDeviceFunction · 0.85
humanFileSizeFunction · 0.85
mapMethod · 0.80

Tested by

no test coverage detected