flâneur — a map of the web's best reading

Tensors — PyTorch Tutorials 2.13.0+cu130 documentation

docs.pytorch.org · 1,411 words · saved by 1 readers

Learn the Basics || Quickstart || Tensors || Datasets & DataLoaders || Transforms || Build Model || Autograd || Optimization || Save & Load Model Created On: Feb 10, 2021 | Last Updated: Apr 30, 2026 | Last Verified: Nov 05, 2024 Tensors are a specialized data structure that are very similar to arrays and matrices. In PyTorch, we use tensors to encode the inputs and outputs of a model, as well as the model’s parameters. Tensors are similar to NumPy’s ndarrays, except that tensors can run on GPUs or other hardware accelerators. In fact, tensors and NumPy arrays can often share the same underlying memory, eliminating the need to copy data (see Bridge with NumPy). Tensors are also optimized for automatic differentiation (we’ll see more about that later in the Autograd section). If you’re familiar with ndarrays, you’ll be right at home with the Tensor API. If not, follow along! Tensors can be initialized in various ways. Take a look at the following examples: Directly from data Tensors can

Note Go to the end to download the full example code. Learn the Basics || Quickstart || Tensors || Datasets & DataLoaders || Transforms || Build Model || Autograd || Optimization || Save & Load Model Tensors # Created On: Feb 10, 2021 | Last Updated: Apr 30, 2026 | Last Verified: Nov 05, 2024 Tensors are a specialized data structure that are very similar to arrays and matrices. In PyTorch, we use tensors to encode the inputs and outputs of a model, as well as the model’s parameters. Tensors are similar to NumPy’s ndarrays, except that tensors can run on GPUs or other hardware accelerators. In

Explore this link on the map →

related reading