# @tensorflow/tfjs-core

> Hardware-accelerated JavaScript library for machine intelligence

Latest version **4.22.0** (published 2024-10-21) · Apache-2.0 license · 0 weekly downloads

## Install

```sh
npm install @tensorflow/tfjs-core
pnpm add @tensorflow/tfjs-core
yarn add @tensorflow/tfjs-core
bun add @tensorflow/tfjs-core
```

## Health

**Score 55/100 (C)** — status: stable.

Positive: has types; esm support; no vulnerabilities; high quality score; popular repo.

Warnings: low downloads; large bundle.

Negative: stale.

## Facts

| | |
|---|---|
| Version | 4.22.0 |
| Published | 2024-10-21 |
| First published | 2018-03-17 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 7 |
| Unpacked size | 35.4 MB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 19141 |
| Maintainers | delhibabu, laxma4675, fengwuyao, linchan, pyu10055, caisq, annxingyuan, linazhao128, mattsoulanille, jinjingforever |

## Links

- npm: https://www.npmjs.com/package/@tensorflow/tfjs-core
- Repository: https://github.com/tensorflow/tfjs
- Homepage: https://github.com/tensorflow/tfjs#readme
- Issues: https://github.com/tensorflow/tfjs/issues
- npm.io page: https://npm.io/package/@tensorflow/tfjs-core

## Dependencies (7)

- [long](https://npm.io/package/long.md) 4.0.0
- [node-fetch](https://npm.io/package/node-fetch.md) ~2.6.1
- [seedrandom](https://npm.io/package/seedrandom.md) ^3.0.5
- [@types/long](https://npm.io/package/@types/long.md) ^4.0.1
- [@webgpu/types](https://npm.io/package/@webgpu/types.md) 0.1.38
- [@types/seedrandom](https://npm.io/package/@types/seedrandom.md) ^2.4.28
- [@types/offscreencanvas](https://npm.io/package/@types/offscreencanvas.md) ~2019.7.0

## Recent versions

- 4.22.0 (latest) — 2024-10-21
- 4.23.0-rc.0 (next) — 2025-01-08
- 4.22.0-rc.0 — 2024-10-14
- 4.21.0 — 2024-09-03
- 4.21.0-rc.0 — 2024-08-26
- 4.20.0 — 2024-06-03
- 4.20.0-rc.0 — 2024-05-28
- 4.19.0 — 2024-04-30
- 4.19.0-rc.0 — 2024-04-24
- 4.18.0 — 2024-04-17
- 4.18.0-rc.0 — 2024-04-11
- 4.17.0 — 2024-01-30
- 4.17.0-rc.0 — 2024-01-23
- 4.16.0 — 2024-01-11
- 4.16.0-rc.0 — 2024-01-09
- … 173 more at https://npm.io/package/@tensorflow/tfjs-core/versions

## README

# TensorFlow.js Core API

A part of the TensorFlow.js ecosystem, this repo hosts `@tensorflow/tfjs-core`,
the TensorFlow.js Core API, which provides low-level, hardware-accelerated
linear algebra operations and an eager API for automatic differentiation.

Check out [js.tensorflow.org](https://js.tensorflow.org) for more
information about the library, tutorials and API docs.

To keep track of issues we use the [tensorflow/tfjs](https://github.com/tensorflow/tfjs) Github repo.

## Importing

You can install TensorFlow.js via yarn or npm. We recommend using the
[@tensorflow/tfjs](https://www.npmjs.com/package/@tensorflow/tfjs) npm package,
which gives you both this Core API and the higher-level
[Layers API](/tfjs-layers):

```js
import * as tf from '@tensorflow/tfjs';
// You have the Core API: tf.matMul(), tf.softmax(), ...
// You also have Layers API: tf.model(), tf.layers.dense(), ...
```

On the other hand, if you care about the bundle size and you do not use the
Layers API, you can import only the Core API:

```js
import * as tfc from '@tensorflow/tfjs-core';
// You have the Core API: tfc.matMul(), tfc.softmax(), ...
// No Layers API.
```

**Note**: If you are only importing the Core API, you also need to import a
backend (e.g., [tfjs-backend-cpu](/tfjs-backend-cpu),
[tfjs-backend-webgl](/tfjs-backend-webgl), [tfjs-backend-wasm](/tfjs-backend-wasm)).

For info about development, check out [DEVELOPMENT.md](/DEVELOPMENT.md).

## For more information

- [TensorFlow.js API documentation](https://js.tensorflow.org/api/latest/)
- [TensorFlow.js Tutorials](https://js.tensorflow.org/tutorials/)

Thanks <a href="https://www.browserstack.com/">BrowserStack</a> for providing testing support.

---
_Source: https://npm.io/package/@tensorflow/tfjs-core · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
