PitchHut
Log in / Sign up
Tensor-Puzzles
8 views
Master PyTorch through the art of puzzle solving.
Pitch

Dive into 21 engaging tensor puzzles designed to enhance your understanding of PyTorch and NumPy. Each challenge encourages you to implement functions from scratch, fostering deeper familiarity with tensor operations and broadcasting. Whether you're a beginner or an expert, refine your skills while having fun. Start solving today!

Description

Tensor Puzzles is an engaging collection designed to sharpen your PyTorch skills through hands-on problem-solving. Created by Sasha Rush with contributions from Marcos Treviso, this repository features 21 unique tensor puzzles that challenge you to reimplement standard NumPy library functions without relying on built-in shortcuts or external resources.

Why Tensor Puzzles?

When mastering tensor programming languages like PyTorch or NumPy, it's easy to lean on the standard library or StackOverflow for quick solutions. However, the real power lies in understanding and utilizing the expressive capabilities of tensor languages from first principles. Tensor Puzzles help you achieve just that!
Each puzzle simulates the essence of coding practices without replicating complex real-world scenarios, allowing you to focus on developing a deep understanding of broadcasting and tensor operations.

How It Works

  • Each puzzle is designed to be solved in a single line of code (<80 columns).
  • You're tasked with reimplementing functions like ones, sum, outer, and more—think of them as exercises to improve your coding proficiency in a stimulating environment.
  • You must avoid using standard library shortcuts. The only allowed functions are related to basic arithmetic and logical operations, along with previous puzzle implementations.

Getting Started

To jump right in, it's recommended to use Google Colab. You can open the notebook here to begin solving puzzles in an interactive setup.

For further insights, check out our YouTube walkthrough which provides a detailed guide on how to tackle these puzzles.

Example Puzzle

Here's a quick look at one of the puzzles you might encounter:

def ones(i: int) -> TT["i"]:  
    raise NotImplementedError

The goal is to reimplement the ones function, designed to return a vector consisting entirely of ones.

Each puzzle not only enhances your coding skills but also deepens your understanding of tensor operations by emphasizing the importance of simple, eloquent code.

Are You Ready?

Challenge yourself with exhilarating problems and unlock the full potential of tensor programming! Dive into Tensor Puzzles today and elevate your PyTorch knowledge.