Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
128 commits
Select commit Hold shift + click to select a range
be99f76
yarn initialize
veehz Oct 3, 2025
2bd8956
Initialise code structure
veehz Oct 7, 2025
8fa1abc
feat: use with pyodide
veehz Oct 8, 2025
dd15d5a
refactor: rename files and internal functions, remove extraneous base…
veehz Oct 8, 2025
e56e6a0
feat: functional
veehz Oct 8, 2025
eaa0598
feat: github workflow test
veehz Oct 8, 2025
e6570ce
docs: pyodide instructions to run
veehz Oct 8, 2025
caa8c22
Add eslint and prettier
veehz Oct 8, 2025
4ab6401
feat: creation functions
veehz Oct 12, 2025
c871a3e
feat: macros with jinja2, matmul, transpose
veehz Oct 12, 2025
729a852
feat: operation access modifiers
veehz Oct 12, 2025
8b2a7de
feat: typedoc
veehz Oct 12, 2025
7a2984b
fix sum, mean export
veehz Oct 12, 2025
f24990e
refactor: code formatting
veehz Oct 12, 2025
78ac928
feat: nn layers and modules
veehz Oct 12, 2025
0220198
feat: optimizers
veehz Oct 12, 2025
b7999ab
feat: detach
veehz Oct 12, 2025
967b39f
feat: more operations
veehz Oct 12, 2025
3f31912
feat: caching operations and kernels
veehz Oct 12, 2025
6010cb8
feat: pipelining
veehz Oct 13, 2025
9e31d7f
fix: remove unused utils file
veehz Oct 13, 2025
42f91dd
feat: gpu support inspection
veehz Oct 13, 2025
e6c5977
feat: build and publish built files to github pages
veehz Oct 13, 2025
cae6f71
feat: gpu support inspection browser
veehz Oct 13, 2025
6aa86b9
feat: use cpu
veehz Oct 13, 2025
4111009
feat: tensor toArray for future Texture use
veehz Oct 13, 2025
282331b
feat: kernel options and powint
veehz Oct 13, 2025
c034b5e
feat: use mocha instead of jest and add browser tests
veehz Oct 13, 2025
e42a0ca
add NOTICE and gpu.js license
veehz Oct 13, 2025
afe4f3c
feat: reshape operation
veehz Oct 13, 2025
ec5b617
refactor: creation operations
veehz Oct 15, 2025
4f64679
feat: unsqueeze operation
veehz Oct 15, 2025
6aab5fc
feat: test template
veehz Oct 15, 2025
83f960d
feat: development scripts with watch
veehz Oct 15, 2025
29702f4
docs: pytorch docs license
veehz Oct 15, 2025
ea51460
feat: yarn serve and yarn watch
veehz Oct 15, 2025
a678bbc
docs: copy examples to docs
veehz Nov 18, 2025
05057f2
fix: node builds
veehz Oct 16, 2025
1934a2a
feat: square operation
veehz Oct 16, 2025
3339ba7
feat: pyodide bridge
veehz Oct 16, 2025
7c87b5e
feat: VS Code PnP SDKs
veehz Dec 19, 2025
b96994f
fix j2
veehz Dec 19, 2025
00df413
docs: add documentation on codebase
veehz Jan 5, 2026
c5a46cd
refactor: SGD to be same as pytorch docs
veehz Jan 5, 2026
c65cfbc
feat: ones_like and zeros_like
veehz Jan 5, 2026
d949239
feat: maximum and minimum
veehz Jan 5, 2026
df60e59
feat: Adam Optimizer
veehz Jan 5, 2026
bda7a43
fix: use yarn instead of npm
veehz Jan 5, 2026
b88c9e0
fix: pyodide page point to correct gpu js file
veehz Jan 18, 2026
e6be197
feat: example shows error if script loading fail
veehz Jan 18, 2026
d1bb0cc
feat: remove debug statements from bridge.py
veehz Jan 18, 2026
6fb6f94
feat: build process and publish
veehz Jan 21, 2026
0f14e5b
wip sigmoid function
veehz Jan 21, 2026
4fd6c08
feat: use cpu directly instead of via gpu.js
veehz Jan 23, 2026
d300257
refactor: complete removal of gpu.js dependency
veehz Feb 6, 2026
e1e792b
feat: event emitters for backpropagation
veehz Feb 6, 2026
21bdfab
feat: use AccumulateGrad and retain_grad
veehz Feb 6, 2026
a595fee
fix: error handling for github workflow
veehz Feb 6, 2026
c37cfa0
feat: id for all tensor and operations
veehz Feb 12, 2026
6449e13
feat: eventBus for tensors and operations
veehz Feb 27, 2026
a366a64
feat: eventBus event constants
veehz Feb 28, 2026
5dc2165
feat: export AccumulateGrad
veehz Feb 28, 2026
089a398
feat: emits requires grad for forward
veehz Feb 28, 2026
9f90122
feat: emit before and after accumulate grad
veehz Feb 28, 2026
4cdcdef
feat: nn.Sequential
veehz Mar 2, 2026
2e37563
feat: fix build config and examples
veehz Mar 2, 2026
b5dee40
fix: matrix and transpose backward
veehz Mar 3, 2026
d452598
fix: backward shape
veehz Mar 3, 2026
161f966
feat: add test for linear backward
veehz Mar 3, 2026
b1c6561
feat: rename Operation -> TorchFunction
veehz Mar 3, 2026
e9d287c
fix: browser test
veehz Mar 3, 2026
714485e
feat: optional name for tensor
veehz Mar 6, 2026
47a597d
feat: use lambda and remove jinja2
veehz Mar 6, 2026
af152f7
feat: automated testing
veehz Mar 8, 2026
f5fe9c7
feat: compare NaN in generated tests
veehz Mar 8, 2026
69d807b
feat: verify that generated tests are up to date
veehz Mar 8, 2026
d579ad1
feat: use cpu-only torch for minimal installation
veehz Mar 8, 2026
3fa5a31
feat: sanity check in auto-generated tests
veehz Mar 8, 2026
382ca02
feat: add generated testcases for broadcast and matmul
veehz Mar 8, 2026
df01169
feat: auto test Linear and Optimizer
veehz Mar 8, 2026
34bc280
feat: reduction mixin and tests
veehz Mar 8, 2026
6d0397c
fix: auto test sanity check
veehz Mar 8, 2026
a7981cb
fix: visibility
veehz Mar 8, 2026
9ba7209
feat: make shape public
veehz Mar 8, 2026
fadb58e
fix: export types for docs
veehz Mar 8, 2026
bac9873
feat: keep constructor.name in mixin
veehz Mar 9, 2026
0632a9d
refactor: nn modules
veehz Mar 10, 2026
ac76c58
feat: Convolutions
veehz Mar 10, 2026
3c9e8a1
docs: package scripts
veehz Mar 10, 2026
2d53642
style: reformat code
veehz Mar 10, 2026
68edc2a
docs: fix build files and add timeout minutes
veehz Mar 10, 2026
3a5504f
style: eslint
veehz Mar 10, 2026
2da90ed
feat: restrict torch and numpy versions
veehz Mar 10, 2026
c2c560c
feat: test coverage
veehz Mar 10, 2026
1838031
ci: update to node 24 in github actions
veehz Mar 10, 2026
62456ef
fix: maxi/minimum and pow edge cases, and add edge tests, nan_to_num
veehz Mar 10, 2026
89ae786
feat: no_grad mode
veehz Mar 10, 2026
cac25db
refactor: remove unused vars
veehz Mar 10, 2026
4686463
fix: TorchFunction backward arb type
veehz Mar 10, 2026
f2830fa
feat: export
veehz Mar 11, 2026
1be48e5
refactor: automatic testcase generator
veehz Mar 11, 2026
c5b01a8
fix: export type
veehz Mar 11, 2026
c66c99f
feat: loss test and fix unary fn bug
veehz Mar 11, 2026
119c311
feat: activation and creation tests
veehz Mar 11, 2026
89bf15b
fix: remove scratch files
veehz Mar 11, 2026
491a0ff
docs: remove done todo
veehz Mar 11, 2026
f4729e9
ci: clarify workflow test descriptions.
veehz Mar 11, 2026
d93f506
chore: remove jest config as we use mocha
veehz Mar 11, 2026
b9309e8
docs: pyodide example as package
veehz Mar 16, 2026
60c4465
feat: support pyodide and tests
veehz Mar 17, 2026
78a5f95
feat: shape and toString
veehz Mar 18, 2026
8e7aedb
feat: tensor.size()
veehz Mar 18, 2026
23fca0d
ci: docs/examples
veehz Mar 18, 2026
88cbd07
feat: no minify for npm, minify for cdn
veehz Mar 20, 2026
df63799
ci: test in browser
veehz Mar 20, 2026
63c23de
fix(package): correct types path in package.json
veehz Mar 20, 2026
0d1ea2d
feat: prng and numel
veehz Mar 20, 2026
dc63afb
feat: tensor toString format
veehz Mar 22, 2026
209def3
feat: tensor views and storage
veehz Mar 22, 2026
10418de
feat: indexing, more creation, CrossEntropyLoss, tests
veehz Mar 22, 2026
c36f98d
feat: export relu and sigmoid
veehz Mar 22, 2026
5739c65
fix: correct Parameter namespace
veehz Mar 22, 2026
02b8ada
fix: browser test
veehz Mar 22, 2026
6007969
feat: flatten, bias arg to Linear, reduction arg to loss functions
veehz Mar 22, 2026
554da62
test: parameter tests
veehz Mar 25, 2026
ff76db1
ci: use actions for gh-pages docs
veehz Mar 26, 2026
c812bdd
ci: remove redundant comments
veehz Mar 26, 2026
2137beb
chore: ignore .envrc and shell.nix
veehz Mar 28, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
root = true

[*]
insert_final_newline = true
end_of_line = lf

[*.{ts,tsx,json}]
indent_style = space
indent_size = 2

[*.md]
indent_style = space
indent_size = 2

[*.{html,css}]
indent_style = space
indent_size = 4
59 changes: 59 additions & 0 deletions .github/workflows/build-test-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: Build, Test, Publish

on: [push]

jobs:
test-publish:
name: Build, test, and publish package
runs-on: ubuntu-latest
permissions:
contents: read
timeout-minutes: 10
steps:
- uses: actions/checkout@v6
- run: corepack enable
- uses: actions/setup-node@v6
with:
node-version: 24
cache: yarn

- run: yarn install --immutable

- run: yarn test:coverage
- run: yarn build
- run: yarn test:build

- name: Test in browser (If UMD tests are failing, check torch-bridge.js)
run: |
yarn serve &
npx wait-on tcp:8080
npx mocha-headless-chrome -a no-sandbox -t 60000 -f http://127.0.0.1:8080/test/index.html
npx mocha-headless-chrome -a no-sandbox -t 60000 -f http://127.0.0.1:8080/test/umd.html

- name: Build docs and prepare directory
run: |
yarn docs
mkdir -p docs/media
[ -d "build" ] && cp -r build docs/build
[ -d "build" ] && cp -r build docs/media/build
[ -d "examples" ] && cp -r examples docs/examples
[ -d "examples" ] && cp -r examples docs/media/examples

- uses: actions/upload-pages-artifact@v4
with:
path: './docs'

- run: yarn pkg-pr-new publish

deploy-docs:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
permissions:
pages: write
id-token: write
needs: test-publish
steps:
- uses: actions/deploy-pages@v5
id: deployment
36 changes: 36 additions & 0 deletions .github/workflows/pyodide-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Pyodide Test

on: [push]

jobs:
pyodide-test:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v6
- run: corepack enable
- uses: actions/setup-node@v6
with:
node-version: 24
cache: yarn

- run: yarn install --immutable

- run: yarn build

- name: Install Pyodide example dependencies
run: cd examples/pyodide && yarn install --immutable

- uses: actions/setup-python@v6
with:
python-version: '3.14'
cache: 'pip'
cache-dependency-path: scripts/requirements.txt

- run: pip install -r scripts/requirements.txt

- name: Generate PyTorch output
run: cd examples/pyodide && yarn gen-cache

- name: Run Pyodide Tests
run: cd examples/pyodide && yarn test-pyodide
37 changes: 37 additions & 0 deletions .github/workflows/verify-generated-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Verify Generated Tests

on: [push]

jobs:
verify-sync:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v6
- run: corepack enable
- uses: actions/setup-node@v6
with:
node-version: 24
cache: yarn

- run: yarn install --immutable

- uses: actions/setup-python@v6
with:
python-version: '3.14'
cache: 'pip'
cache-dependency-path: scripts/requirements.txt

- run: pip install -r scripts/requirements.txt

- name: Sanity Check Generated File Length
run: |
COMMITTED_LINES=$(wc -l < test/testcases.gen.js)
yarn update-tests
GENERATED_LINES=$(wc -l < test/testcases.gen.js)
if [ "$COMMITTED_LINES" -ne "$GENERATED_LINES" ]; then
echo "❌ Line count mismatch! Committed: $COMMITTED_LINES, Generated: $GENERATED_LINES."
echo "Please run 'yarn update-tests' locally and commit the updated test file."
exit 1
fi
echo "✅ Line counts match ($COMMITTED_LINES lines). Sanity check passed."
61 changes: 61 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
# See https://help.github.com/ignore-files/ for more about ignoring files.
/docs

.direnv
.envrc
/shell.nix
.idea
/test.js
/test.py

# dependencies
/node_modules

# testing
/coverage

# production
/build
src/styles/*.css
/.env

# deployment
terraform*

# sourceror bundle
/public/externalLibs/sourceror

# misc
.DS_Store
.env.local
.env.development.local
.env.test.local
.env.production.local
.idea/

npm-debug.log*
.eslintcache
yarn-error.log

# emacs backup files

*~

# yarn files

.yarn/*
!.yarn/patches
!.yarn/plugins
!.yarn/releases
!.yarn/sdks
!.yarn/versions

# Swap the comments on the following lines if you wish to use zero-installs
# In that case, don't forget to run `yarn config set enableGlobalCache false`!
# Documentation here: https://yarnpkg.com/features/caching#zero-installs

#!.yarn/cache
.pnp.*

# We use .node-version
/.tool-versions
8 changes: 8 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"semi": true,
"singleQuote": true,
"printWidth": 100,
"arrowParens": "avoid",
"trailingComma": "none",
"endOfLine": "auto"
}
32 changes: 32 additions & 0 deletions .yarn/sdks/eslint/bin/eslint.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
#!/usr/bin/env node

const {existsSync} = require(`fs`);
const {createRequire, register} = require(`module`);
const {resolve} = require(`path`);
const {pathToFileURL} = require(`url`);

const relPnpApiPath = "../../../../.pnp.cjs";

const absPnpApiPath = resolve(__dirname, relPnpApiPath);
const absUserWrapperPath = resolve(__dirname, `./sdk.user.cjs`);
const absRequire = createRequire(absPnpApiPath);

const absPnpLoaderPath = resolve(absPnpApiPath, `../.pnp.loader.mjs`);
const isPnpLoaderEnabled = existsSync(absPnpLoaderPath);

if (existsSync(absPnpApiPath)) {
if (!process.versions.pnp) {
// Setup the environment to be able to require eslint/bin/eslint.js
require(absPnpApiPath).setup();
if (isPnpLoaderEnabled && register) {
register(pathToFileURL(absPnpLoaderPath));
}
}
}

const wrapWithUserWrapper = existsSync(absUserWrapperPath)
? exports => absRequire(absUserWrapperPath)(exports)
: exports => exports;

// Defer to the real eslint/bin/eslint.js your application uses
module.exports = wrapWithUserWrapper(absRequire(`eslint/bin/eslint.js`));
32 changes: 32 additions & 0 deletions .yarn/sdks/eslint/lib/api.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
#!/usr/bin/env node

const {existsSync} = require(`fs`);
const {createRequire, register} = require(`module`);
const {resolve} = require(`path`);
const {pathToFileURL} = require(`url`);

const relPnpApiPath = "../../../../.pnp.cjs";

const absPnpApiPath = resolve(__dirname, relPnpApiPath);
const absUserWrapperPath = resolve(__dirname, `./sdk.user.cjs`);
const absRequire = createRequire(absPnpApiPath);

const absPnpLoaderPath = resolve(absPnpApiPath, `../.pnp.loader.mjs`);
const isPnpLoaderEnabled = existsSync(absPnpLoaderPath);

if (existsSync(absPnpApiPath)) {
if (!process.versions.pnp) {
// Setup the environment to be able to require eslint
require(absPnpApiPath).setup();
if (isPnpLoaderEnabled && register) {
register(pathToFileURL(absPnpLoaderPath));
}
}
}

const wrapWithUserWrapper = existsSync(absUserWrapperPath)
? exports => absRequire(absUserWrapperPath)(exports)
: exports => exports;

// Defer to the real eslint your application uses
module.exports = wrapWithUserWrapper(absRequire(`eslint`));
32 changes: 32 additions & 0 deletions .yarn/sdks/eslint/lib/config-api.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
#!/usr/bin/env node

const {existsSync} = require(`fs`);
const {createRequire, register} = require(`module`);
const {resolve} = require(`path`);
const {pathToFileURL} = require(`url`);

const relPnpApiPath = "../../../../.pnp.cjs";

const absPnpApiPath = resolve(__dirname, relPnpApiPath);
const absUserWrapperPath = resolve(__dirname, `./sdk.user.cjs`);
const absRequire = createRequire(absPnpApiPath);

const absPnpLoaderPath = resolve(absPnpApiPath, `../.pnp.loader.mjs`);
const isPnpLoaderEnabled = existsSync(absPnpLoaderPath);

if (existsSync(absPnpApiPath)) {
if (!process.versions.pnp) {
// Setup the environment to be able to require eslint/config
require(absPnpApiPath).setup();
if (isPnpLoaderEnabled && register) {
register(pathToFileURL(absPnpLoaderPath));
}
}
}

const wrapWithUserWrapper = existsSync(absUserWrapperPath)
? exports => absRequire(absUserWrapperPath)(exports)
: exports => exports;

// Defer to the real eslint/config your application uses
module.exports = wrapWithUserWrapper(absRequire(`eslint/config`));
32 changes: 32 additions & 0 deletions .yarn/sdks/eslint/lib/types/config-api.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
#!/usr/bin/env node

const {existsSync} = require(`fs`);
const {createRequire, register} = require(`module`);
const {resolve} = require(`path`);
const {pathToFileURL} = require(`url`);

const relPnpApiPath = "../../../../../.pnp.cjs";

const absPnpApiPath = resolve(__dirname, relPnpApiPath);
const absUserWrapperPath = resolve(__dirname, `./sdk.user.cjs`);
const absRequire = createRequire(absPnpApiPath);

const absPnpLoaderPath = resolve(absPnpApiPath, `../.pnp.loader.mjs`);
const isPnpLoaderEnabled = existsSync(absPnpLoaderPath);

if (existsSync(absPnpApiPath)) {
if (!process.versions.pnp) {
// Setup the environment to be able to require eslint/config
require(absPnpApiPath).setup();
if (isPnpLoaderEnabled && register) {
register(pathToFileURL(absPnpLoaderPath));
}
}
}

const wrapWithUserWrapper = existsSync(absUserWrapperPath)
? exports => absRequire(absUserWrapperPath)(exports)
: exports => exports;

// Defer to the real eslint/config your application uses
module.exports = wrapWithUserWrapper(absRequire(`eslint/config`));
32 changes: 32 additions & 0 deletions .yarn/sdks/eslint/lib/types/index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
#!/usr/bin/env node

const {existsSync} = require(`fs`);
const {createRequire, register} = require(`module`);
const {resolve} = require(`path`);
const {pathToFileURL} = require(`url`);

const relPnpApiPath = "../../../../../.pnp.cjs";

const absPnpApiPath = resolve(__dirname, relPnpApiPath);
const absUserWrapperPath = resolve(__dirname, `./sdk.user.cjs`);
const absRequire = createRequire(absPnpApiPath);

const absPnpLoaderPath = resolve(absPnpApiPath, `../.pnp.loader.mjs`);
const isPnpLoaderEnabled = existsSync(absPnpLoaderPath);

if (existsSync(absPnpApiPath)) {
if (!process.versions.pnp) {
// Setup the environment to be able to require eslint
require(absPnpApiPath).setup();
if (isPnpLoaderEnabled && register) {
register(pathToFileURL(absPnpLoaderPath));
}
}
}

const wrapWithUserWrapper = existsSync(absUserWrapperPath)
? exports => absRequire(absUserWrapperPath)(exports)
: exports => exports;

// Defer to the real eslint your application uses
module.exports = wrapWithUserWrapper(absRequire(`eslint`));
Loading