Skip to content
Related Articles

Related Articles

Improve Article

Tensorflow.js Function

  • Last Updated : 01 Jun, 2021

Tensorflow.js is an open-source library developed by Google for running machine learning models and deep learning neural networks in the browser or node environment. It also helps the developers to develop ML models in JavaScript language and can use ML directly in the browser or in Node.js.

The function is used for creating a dataset by zipping together a dict, array, or nested structure of Dataset.

Hey geek! The constant emerging technologies in the world of web development always keeps the excitement for this subject through the roof. But before you tackle the big projects, we suggest you start by learning the basics. Kickstart your web development journey by learning JS concepts with our JavaScript Course. Now at it's lowest price ever!



  • dataset: It is the set of data.

Return Value: It returns the

Example 1:


// Importing the tensorflow.js library
import * as tf from "@tensorflow/tfjs"
// Initializing Array dataset.
let geek1 =[1, 2, 3, 4]);
let geek2 =[5, 6, 7, 8]);
// Ziping dataset of objects.
let geek3 =[geek1, geek2]);
// Printing the returned promise.  
await geek3.forEachAsync(function(geek){



Example 2:


// Importing the tensorflow.js library
import * as tf from "@tensorflow/tfjs"
// Ziping two array dataset.
let geek ={
    geek1:[1, 2, 3, 4]), 
    geek2:[5, 6, 7, 8])
// Printing the result.
await geek.forEachAsync(function(e){




My Personal Notes arrow_drop_up
Recommended Articles
Page :