Skip to content

Tutorials

Learn how to use TensorPlay for various deep learning tasks, from basic model building to advanced optimizations.

Beginner Tutorials

1. Image Classification with CNN

Learn how to build and train a Convolutional Neural Network (CNN) on the MNIST dataset using tensorplay.nn.

  • Topics: nn.Conv2d, nn.MaxPool2d, nn.ReLU, DataLoader, optimizer.Adam.

2. Linear Regression from Scratch

Understand the fundamentals of autograd by implementing a simple linear regression model.

  • Topics: tp.Tensor, requires_grad, loss.backward(), manual gradient updates.

Intermediate Tutorials

3. Custom Datasets and Transforms

Learn how to load your own data and apply pre-processing using the tensorplay.data module.

  • Topics: Dataset class, DataLoader workers, transforms.Compose.

4. Saving and Loading Models

Understand how to save model weights and resume training.

  • Topics: tp.save(), tp.load(), state_dict.

Advanced Tutorials

5. Custom Autograd Functions

Extend TensorPlay's autograd engine with your own custom forward and backward logic.

  • Topics: tpx.autograd.Function, implementing forward and backward static methods.

6. Static Graph Optimization with Stax

Accelerate your models using the Stax static graph compiler.

  • Topics: @tp.compile, operator fusion, graph capturing.

7. Building Custom C++ Extensions

Learn how to write efficient CUDA/C++ kernels and bind them to TensorPlay using nanobind.

  • Topics: p10::TensorImpl, Dispatcher, custom kernel registration.

Community Tutorials

Found a great tutorial or wrote one? Contribute it to our resources!

Released under the Apache 2.0 License.

📚DeepWiki