    };

                    request.onsuccess = () => {
                        console.log('Tensor saved successfully.');
                        resolve();
                    };

                    request.onerror = (event) => {
                        console.error('Tensor save failed:', event.target.error);
                        resolve(null);
                    };
                });
            } else {
                return null;
            }
        }).catch(()=> null);
    }

    function re