From the course: Learning TensorFlow with JavaScript

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Your first tensor

Your first tensor

From the course: Learning TensorFlow with JavaScript

Start my 1-month free trial

Your first tensor

- [Instructor] A tensor is the central unit of data where you can add values in multidimensional arrays. We can shape our tensor to be multiple arrays of a specific number of columns. Let's take a look at how this works. So, the first thing we are gonna do is remove the content log here, like so. And what we'll do first is create a variable called "data" and use dtf, so basically everything starts with tf. So when you're leveraging the library TensorFlow, you start with tf, and then pass whatever method you need to use. So for example, here we're going to create a tensor. And that's a method that takes the options of what are the tensors. So this is a method that actually takes the tensors, or the array of numbers. So, in this case we'll create four arrays of two numbers. So, let's go and create that, and let's create the first array. And add "4,6" in this first one, and then create a second one, and in this one lets do "5,9", and then let's create a third one, and in this one we'll…

Contents