Skip to content

Commit

Permalink
show tensor details in legend (#310)
Browse files Browse the repository at this point in the history
  • Loading branch information
aidemsined authored Jan 8, 2025
2 parents c835012 + fc4e686 commit 072fd04
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 4 deletions.
6 changes: 6 additions & 0 deletions src/components/operation-details/MemoryLegendElement.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ export const MemoryLegendElement: React.FC<{
<div
className={classNames('legend-details', {
'extra-info': bufferType || layout,
'shape-info': derivedTensor,
})}
>
<div className='format-numbers monospace'>{prettyPrintAddress(chunk.address, memSize)}</div>
Expand All @@ -96,6 +97,11 @@ export const MemoryLegendElement: React.FC<{
{layout && <span className='monospace'>{DeviceOperationLayoutTypes[layout]}</span>}
</div>
)}
{derivedTensor && (
<div className='shape-info-slot'>
{derivedTensor.shape} &nbsp; {derivedTensor.dtype}
</div>
)}
</div>
</Component>
);
Expand Down
2 changes: 0 additions & 2 deletions src/model/APIData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ import { RemoteConnection, RemoteFolder } from '../definitions/RemoteConnection'
import { MemoryConfig } from '../functions/parseMemoryConfig';

export interface TensorData extends Tensor {
shape: string;
dtype: string;
layout: string;
memory_config: MemoryConfig | null;
device_id: number | null;
Expand Down
2 changes: 2 additions & 0 deletions src/model/Graph.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ export interface Tensor {
producerNames: string[];
consumerNames: string[];
memory_config: MemoryConfig | null;
shape: string;
dtype: string;
}

export interface HistoricalTensor extends Tensor {
Expand Down
12 changes: 10 additions & 2 deletions src/scss/components/MemoryLegendElement.scss
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,20 @@

.legend-details {
display: inline-grid;
grid-template-columns: 0.7fr 1.2fr 0.75fr 1fr;
grid-template-columns: 0.2fr 1.2fr 0.5fr 1fr 2fr;
gap: 15px;
text-align: left;

&.extra-info {
grid-template-columns: 0.7fr 1.2fr 0.75fr 1fr 2fr;
grid-template-columns: 0.2fr 1.2fr 0.5fr 1fr 2fr;
}

&.shape-info {
grid-template-columns: 0.2fr 1.2fr 0.5fr 1fr 2fr;
}

&.extra-info.shape-info {
grid-template-columns: 0.2fr 1.2fr 0.5fr 1fr 2fr 3fr;
}
}

Expand Down

0 comments on commit 072fd04

Please sign in to comment.