Skip to content
master
Switch branches/tags
tfjs/tfjs-core/
tfjs/tfjs-core/

Latest commit

As commented by amaiorano@google.com https://bugs.chromium.org/p/tint/issues/detail?id=1144#c5:
The GLSL mod and WGSL '%' are defined differently.
GLSL: mod returns the value of x modulo y. This is computed as x - y * floor(x/y).
(See https://www.khronos.org/registry/OpenGL-Refpages/gl4/html/mod.xhtml)

WGSL: '%' is floating point remainder, where sign of non-zero result matches sign of e1. Component-wise when T is a vector.
Result equals to: e1 - e2 * trunc(e1 / e2).
(See https://gpuweb.github.io/gpuweb/wgsl/#arithmetic-expr)

In this PR, mod and modVec4 can be used as alternatives to GLSL's mod, not WGSL's '%'.
aff9bfb

Git stats

Files

Permalink
Failed to load latest commit information.

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 for more information about the library, tutorials and API docs.

To keep track of issues we use the tensorflow/tfjs Github repo.

Importing

You can install TensorFlow.js via yarn or npm. We recommend using the @tensorflow/tfjs npm package, which gives you both this Core API and the higher-level Layers API:

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:

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-webgl, tfjs-backend-wasm).

For info about development, check out DEVELOPMENT.md.

For more information

Thanks BrowserStack for providing testing support.