Tensor Operations

Tensors are the common language between data and deep learning. Every image, every sentence, every gradient flows through them.

Build 1.5 hr Python

Prerequisites: Phase 1, Lessons 01 (Linear Algebra Intuition), 02 (Vectors, Matrices & Operations)

#Learning Objectives

  • Implement a tensor class with shape, strides, reshape, transpose, and element-wise operations from scratch
  • Apply broadcasting rules to operate on tensors of different shapes without copying data
  • Write einsum expressions for dot products, matrix multiplications, outer products, and batched operations
  • Trace the exact tensor shapes through every step of multi-head attention
Full Access lesson

Keep going. The rest of this lesson is one step away.

Unlock all 503 lessons, video, code, quizzes and every future update. Pay in your own currency with Paystack.

The text and code of this lesson are based on AI Engineering from Scratch by Rohit Ghumare, MIT licensed.