Open seanshpark opened 1 week ago
fetchOndemand()
will provide the feature as of nowWhere this object be consumed?
view.Value
?view.ValueView
?view.TensorView
?Related
metrics.Tensor
weight
icon from view.ValueView
ctor
if (initializer && source !== 'attribute') {
const element = this.createElement('div', 'sidebar-item-value-button');
element.classList.add('sidebar-item-value-button-tool');
element.setAttribute('title', 'Show Tensor');
element.innerHTML = `<svg class='sidebar-find-content-icon'><use href="#sidebar-icon-weight"></use></svg>`;
element.addEventListener('pointerenter', () => this.emit('focus', this._value));
element.addEventListener('pointerleave', () => this.emit('blur', this._value));
element.style.cursor = 'pointer';
element.addEventListener('click', () => this.emit('activate', this._value));
this.control(element);
}
(just thinking)
In view.Context
, say, to delay the loading of stream
,
streamProxy
instead of stream
, stream
properties, like position
, length
async fetch(file) {
const stream = await this._context.request(file, null, this._base);
return new view.Context(this, file, stream, new Map());
}
this._context
is host.ElectronHost.Context
request
will forward to host.ElectronHost.request()
new Promois
fs.readFile(pathname, encoding, (err, data) => {
if (err) {
reject(err);
} else {
resolve(encoding ? data : new base.BinaryStream(data));
}
});
or
resolve(new host.ElectronHost.FileStream(pathname, 0, stat.size, stat.mtimeMs));
where ElectronHost
is used ?
window.addEventListener('load', () => {
const value = new host.ElectronHost();
window.__view__ = new view.View(value);
window.__view__.start();
});
host.ElectronHost
async _open(location) {
...
if (path && this._view.accept(path, size)) {
this._view.show('welcome spinner');
let context = null;
try {
context = await this._context(path);
calls
host.ElectronHost _open [object Object] path/file.onnx
view.View accept path/file.onnx
host.ElectronHost _context path/file.onnx
host.ElectronHost request file.onnx null path
host.ElectronHost _context file path/file.onnx
view.ModelFactoryService _openContext: [object Object] _context,_tags,_content,_stream,_base,_identifier
view.Context fetch2 1: [object Object] undefined
-> view.ModelFactoryService _openContext
looks like view.Context
Promise
object doesn't have any properties that we can check with hasOwnProperty()
Doing...
this.locations.set(keys[i], streams[i]);
view.ValueView.ctor
host.ElectronHost.request()
itself is still running after graph has shown.
and
resolve(encoding ? data : new base.BinaryStream(data));
is executed.
Purpose: to add something like
fetchOndemand()
The
weight
icon?