Search⌘ K
AI Features

PyTorch Tensors

Explore the concept of tensors in PyTorch, covering their dimensions, creation methods, shape attributes, and how to reshape and clone tensors. Understand the role of detach in managing tensor data flow, providing a foundation for building deep learning models.

We'll cover the following...

Diving into tensors

First, we need to cover a few basic concepts that may throw you off balance if you do not grasp them well enough before going full-force on modeling.

In Deep Learning, we see tensors everywhere. Well, Google’s framework is called TensorFlow for a reason! What is a tensor, anyway?

Tensor

In Numpy, you may have an array that has three dimensions, right? That is, technically speaking, a tensor.

...

A scalar (a single number) has zero dimensions, a vector has one dimension, a matrix has two dimensions, and a tensor has three or more dimensions. That’s it! ...