Skip to content

Tensor and Operator Basics

Maksim Levental edited this page Aug 16, 2021 · 3 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)
Clone this wiki locally