From b546ffddd86f3a1e667d40e15256a97661efaf46 Mon Sep 17 00:00:00 2001 From: Lutz Roeder Date: Sun, 9 Jun 2024 09:36:26 -0700 Subject: [PATCH] Update view.js (#1240) --- source/view.js | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/source/view.js b/source/view.js index 29fd5bdd178..9ce25b9ff19 100644 --- a/source/view.js +++ b/source/view.js @@ -3607,6 +3607,15 @@ view.FindSidebar = class extends view.Control { } }; +view.Argument = class { + + constructor(name, value, type) { + this.name = name; + this.value = value; + this.type = type; + } +}; + view.Tensor = class { constructor(tensor) { @@ -4094,6 +4103,15 @@ view.Tensor = class { return `${indentation}(undefined)`; } } + + get metrics() { + const entries = this._tensor.metrics || []; + const metrics = new Map(entries.map((entry) => [entry.name, entry])); + if (!metrics.has('sparisity')) { + // this.metrics.set('sparisity', new view.Argument('sparisity', 0, 'float32')); + } + return Array.from(metrics); + } }; view.Quantization = class {