Skip to content
Related Articles

Related Articles

Tensorflow.js Function

View Discussion
Improve Article
Save Article
Like Article
  • Last Updated : 09 Mar, 2022

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.



  • 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]);
// Zipping 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"
// Zipping 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 :

Start Your Coding Journey Now!