({model: {model_data, constants}})
| 551 | // Make this a separate component so it is rendered lazily. |
| 552 | class 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 | |
| 578 | function TensorMemorySection({model}) { |
nothing calls this directly
no test coverage detected