HackerReposA FIELD GUIDE TO OPEN SOURCE
ProSponsor the shelf♧ 0
← Back to top all-time
tensorflow
tfjs
TypeScript2018–2026
tensorflow / tfjs

tfjs

A WebGL accelerated JavaScript library for training and deploying ML models.

19Distinct people
20Mentions
1Explicit recommenders
19.2KGitHub stars
REPOSITORY AT A GLANCE

What to know before exploring

What it is

A WebGL accelerated JavaScript library for training and deploying ML models.

GitHub

Where it is used

No documented product use was verified in the last source check.

What people are saying

> I think my favorite part of this is that inevitably people will write type definitions for TensorFlow.js in TypeScript Actually, it already ships with typescript definitions…

wwwigham used a recommendation phrase. One indexed comment matches. This is a phrase match, not a verdict.

No classified warning is attached to this page. Read the discussions before treating silence as approval.

Also in these discussions

No other repository is repeatedly linked in the same discussions.

This week on Hacker News

Nov 7–Nov 14 UTC · Direct repository links and separately labeled related project stories. Indexed through 11/14/2026, 1:49:46 PM UTC.

No direct repository links were found in the indexed HN discussions over the past seven days. Older discussions are available below.

Mentions over time

HN mentions by year20 dated mentions

Observed mentions: 2018-03-30 19:15:14 UTC to 2026-01-06 20:17:42 UTC.

0123452018-01-01 00:00:00 UTC to 2019-01-01 00:00:00 UTC (exclusive): 5 mentions; 3 submissions, 2 comments20182019-01-01 00:00:00 UTC to 2020-01-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments2020-01-01 00:00:00 UTC to 2021-01-01 00:00:00 UTC (exclusive): 3 mentions; 0 submissions, 3 comments2021-01-01 00:00:00 UTC to 2022-01-01 00:00:00 UTC (exclusive): 3 mentions; 0 submissions, 3 comments2022-01-01 00:00:00 UTC to 2023-01-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments20222023-01-01 00:00:00 UTC to 2024-01-01 00:00:00 UTC (exclusive): 4 mentions; 0 submissions, 4 comments2024-01-01 00:00:00 UTC to 2025-01-01 00:00:00 UTC (exclusive): 2 mentions; 0 submissions, 2 comments2025-01-01 00:00:00 UTC to 2026-01-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2026-01-01 00:00:00 UTC to 2027-01-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments. Incomplete calendar period.2026*

* An incomplete calendar period is marked with an outlined bar. Its count is not directly comparable with a full period.

Counts come from the repository’s dated source evidence. Index cutoff: 2026-11-02 08:16:59 UTC.

View mention counts and date ranges
UTC ranges include their start and exclude their end. Select a period to filter the source evidence.
PeriodStart (UTC)End (exclusive, UTC)MentionsSubmissionsComments
20182018-01-01 00:00:00 UTC2019-01-01 00:00:00 UTC532
20192019-01-01 00:00:00 UTC2020-01-01 00:00:00 UTC101
20202020-01-01 00:00:00 UTC2021-01-01 00:00:00 UTC303
20212021-01-01 00:00:00 UTC2022-01-01 00:00:00 UTC303
20222022-01-01 00:00:00 UTC2023-01-01 00:00:00 UTC101
20232023-01-01 00:00:00 UTC2024-01-01 00:00:00 UTC404
20242024-01-01 00:00:00 UTC2025-01-01 00:00:00 UTC202
20252025-01-01 00:00:00 UTC2026-01-01 00:00:00 UTC000
2026 (partial)2026-01-01 00:00:00 UTC2027-01-01 00:00:00 UTC101

What Hacker News says

20 sources
I don’t think tf.tidy() is a sound API under jvp/grad transformations, also it prevents you from using async which makes it incompatible with GPU backends (or blocks the page), a pretty big issue. https://github.com/tensorflow/tfjs/issues/5468 Thanks for the feedback though, just explaining how we arrived at this API. I hope you’d at least try it out — hopefully you will see when developing that the refs are more flexible than alternatives.
In Show HN: Jax-JS, array library in JavaScript targeting WebGPU
Heck yeah! Love the touches like resize handling or rotation support! Contributions are more than welcome... hint hint ;) > It uses face-api.js to find the face Yeah, I'm using Google AI's Face Detector [1]. There's Tensorflow's Face Landmarks Detection [2] that looked most promising and accurate. But it had two bugs [3][4] that are blockers. The first one got fixed recently, but the other one is still pending. [1] https://ai.google.dev/edge/mediapipe/solutions/vision/face_d... [2] https://github.com/tensorflow/tfjs-models/tree/master/face-l... [3] https://github.com/tensorflow/tfjs/issues/7905 [4] https://github.com/tensorflow/tfjs/issues/8290
In Show HN: I built the most over-engineered Deal With It emoji generator
Could there be something like emscripten-forge/requests-wasm-polyfill for PyTorch with WebGPU? https://github.com/emscripten-forge/requests-wasm-polyfill How does the performance of webgpu-torch compare to compiling PyTorch to WASM with emscripten and WebGPU? tfjs benchmarks: Environment > backend > {WASM, WebGL, CPU, WebGPU, tflite} https://tensorflow.github.io/tfjs/e2e/benchmarks/local-bench... src: https://github.com/tensorflow/tfjs/tree/master/e2e/benchmark... tensorflow/tfjs https://github.com/tensorflow/tfjs tfjs-backend-wasm https://github.com/tensorflow/tfjs/tree/master/tfjs-backend-... tfjs-backend-webgpu https://github.com/tensorflow/tfjs/tree/master/tfjs-backend-... ([...], tflite-support, tflite-micro) From facebookresearch/shumai (a JS tensor library) https://github.com/facebookresearch/shumai/issues/122 : > It doesn't mak
Read the rest
e sense to support anything besides WebGPU at this point. WASM + SIMD is around 15-20x slower on my machine[1]. Although WebGL is more widely supported today, it doesn't have the compute features needed for efficient modern ML (transformers etc) and will likely be a deprecated backend for other frameworks when WebGPU comes online. tensorflow rust has a struct.Tensor: https://tensorflow.github.io/rust/tensorflow/struct.Tensor.h... "ONNX Runtime merges WebGPU backend" https://github.com/microsoft/onnxruntime https://news.ycombinator.com/item?id=35696031 ... TIL about wonnx: https://github.com/webonnx/wonnx#in-the-browser-using-webgpu... microsoft/onnxruntime: https://github.com/microsoft/onnxruntime Apache/arrow has language-portable Tensors for cpp: https://arrow.apache.org/docs/cpp/api/tensor.html and rust: https://docs.rs/arrow/latest/arrow/tensor/struct.Tensor.html and Python: https://arrow.apache.org/docs/python/api/tables.html#tensors https://arrow.apache.org/docs/python/generated/pyarrow.Tenso... Fwiw it looks like the llama.cpp Tensor is from ggml, for which there are CUDA and OpenCL implementations (but not yet ROCm, or a WebGPU shim for use with emscripten transpilation to WASM): https://github.com/ggerganov/llama.cpp/blob/master/ggml.h Are the recommendable ways to cast e.g. arrow Tensors to pytorch/tensorflow? FWIU, Rust has a better compilation to WASM; and that's probably faster than already-compiled-to-JS/ES TensorFlow + WebGPU. What's a fair benchmark?
In PyTorch for WebGPU
It's a pity that tfjs never truly developed any decent ops. E.g. you need lgamma to implement the cap for zero-inflated poisson regression and tfjs simply doesn't have that: https://github.com/tensorflow/tfjs/issues/2011 Those guys simply dropped the ball on the floor, and the further framework development fizzled out. I tried to find if WebGPU could be a replacement, but it's very hard to find a good description of the API surface. MDN also doesn't seem to help much – https://developer.mozilla.org/en-US/docs/Web/API/WebGPU_API I really hope that one day I'll find something similar to pytorch, only in typescript. Tell me I'll live long enough to enjoy that day.
In WebGPU Fundamentals
Speaking of python things, there's an actively developed JavaScript implementation of tensorflow called tensorflow.js, which has its own set of backends to leverage GPUs in browsers or in node.js though webGL, webgpu or node bindings into c++ stuff to get cuda support, alongside wasm and pure js implementations. https://github.com/tensorflow/tfjs
In GPU.js
Yeah! AutoML lets you export a TensorFlow.js version of the model to Google cloud storage, and there's a frontend library, tfjs-automl (https://github.com/tensorflow/tfjs/tree/master/tfjs-automl), that downloads the model and sets it up for detections. Then I'm connecting to the device's webcam with navigator.mediaDevices.getUserMedia, and twice a second send a reference to the video stream object to the detector, which runs inferences locally and returns the coordinates of any detected objects. There's some glue code to do the whole dance to connect to the camera and model, but after that it works pretty seamlessly, on my desktop and mobile browsers
In Show HN: I’m not a data scientist but made a Covid mask detector – Doctor Masky

Showing the 15 most recent of 20 sources. Enable JavaScript to search and browse every indexed mention.

MAKE YOURSELF AT HOME

A few shortcuts

/
Search the collection
?
Open this guide
Esc
Close dialogs and navigation

Your saved repositories and interests stay in this browser.