Skip to content

Tensor and Operator Basics

Driss Guessous edited this page Apr 29, 2024 · 4 revisions

Scope

  • Understand what an operator is in PyTorch
  • Understand what a Tensor is (including stride, dtype, and layout)
  • Understand what views are
  • Understand how to author an operator in PyTorch
  • Understand how to test operators in PyTorch
  • Understand what TensorIterator is

What is a Tensor?

A Tensor consists of:

  • data_ptr, a pointer to a chunk of memory
  • some sizes metadata
  • some strides metadata
  • a storage offset

How to author an operator

Comprehensive guide

TensorIterator

  • Read through the colab notebook (link)
  • Listen to the podcast (link)

Learn about view operations

  • Read through the colab notebook (link)
  • Try out the Tensor Views lab (link)

Bonus Lab

  • After completing the views lab if you have extra time feel free to work through Sasha Rush's Tensor Puzzles
Clone this wiki locally