Serge Aurubin

SERGE AURUBIN

DATA SCIENTIST

Welcome to my blog for everything having to do with data science and analysis. I am always looking for new opportunities to drive business insight using data analysis.

Data & Analytics
  • Data Analysis
  • Power BI
  • Excel
  • Data Pipelines
  • Matillion
Engineering
  • Software Developer
  • Python
  • PHP
  • ReactJS
  • Flutter
  • Front End Dev
  • Back End Dev
Databases
  • MySQL Dev/DBA
  • Oracle DBA
Cloud & AI
  • Amazon Web Services
  • Docker
  • Kubernetes
  • Git
  • Artificial Intelligence
  • Claude
  • OpenAI
Back to Videos

PyTorch Tensors: The Data Structure Behind Deep Learning

Socratica

June 3, 2026   1

Tensors are the primary data structure in PyTorch. They are used to store data, perform mathematical operations, move computations between the CPU and GPU, and build the foundation for neural networks.

In this lesson, we introduce PyTorch tensors from the ground up. We create 1D and 2D tensors, inspect tensor shape, data type, and device, then work through common tensor operations including addition, scalar multiplication, element-wise multiplication, matrix multiplication, broadcasting, reshaping, reduction operations, and indexing.

We also look at GPU support in PyTorch and show how tensors can be moved to CUDA when a compatible GPU is available.

Topics covered:

* What tensors are
* Creating tensors with `torch.tensor()`
* Tensor shape, dtype, and device
* Tensor addition and in-place operations
* Scalar, element-wise, and matrix multiplication
* Broadcasting
* Reshaping tensors
* Sum, mean, and max operations
* Boolean masking and indexing
* Moving tensors between CPU and GPU

This is a practical introduction for Python programmers who want to understand the basic data structure behind PyTorch and deep learning.

Support Socratica on Patreon:...

0 Comments

No comments yet. Be the first to weigh in.

Back to Videos

Login