add tensorflow cpu backend as fallback for webgl backend

When the webgl backend is not available or unsupported,
we fall back to the tensorflow cpu backend.

Tensorflow cpu backend library review by abp and jhm.

Co-authored-by: jomapp <17314077+jomapp@users.noreply.github.com>
This commit is contained in:
abp 2025-11-20 16:02:36 +01:00
parent ff856f821e
commit e196f8f8e4
No known key found for this signature in database
GPG key ID: 791D4EC38A7AA7C2
3 changed files with 16792 additions and 2200 deletions

File diff suppressed because it is too large Load diff

10692
libs/tensorflow.js vendored

File diff suppressed because it is too large Load diff

View file

@ -1,5 +1,6 @@
// Use side-effect import to initialize WebGL backend // Use side effect import to initialize WebGL backend
import "@tensorflow/tfjs-backend-webgl" import "@tensorflow/tfjs-backend-webgl"
import "@tensorflow/tfjs-backend-cpu"
import "@tensorflow/tfjs-core/dist/register_all_gradients" import "@tensorflow/tfjs-core/dist/register_all_gradients"