An open source website I built to explain tensor functions in PyTorch: https://whytorch.org
It makes tricky functions like torch.gather and torch.scatter more intuitive by showing element-level relationships between inputs and outputs.
For any function, you can click elements in the result to see where they came from, or elements in the inputs to see how they contribute to the result to see exactly how it contributes to the result. I found that visually tracing tensor operations clarifies indexing, slicing, and broadcasting in ways reading that the docs can't.
You can also jump straight to WhyTorch from the PyTorch docs pages by modifying the base URL directly.
I launched a week or two back and now have the top post of all time on r/pytorch, which has been pretty fun.
This really nice. For `torch.mul(x, y)`, it would be nice if it highlighted the entire row or column in the other matrix and result. Right now it shows only a single multiplication, which gives a misleading impression of how matrix multiply works. I wouldn't mention it, except that matrix multiplication is so important that it's worth showcasing. I've bookmarked the site and will share it at a pytorch training session I'm leading in a couple of weeks.
https://whytorch.org/torch.mul/
Are you perhaps thinking of torch.matmul? torch.mul (and torch.multiply, and the * operator) perform element-wise multiplication.
torch.matmul was one of the first functions I implemented on WhyTorch and it uses and highlights rows and columns as you would expect.
I’d love to hear any feedback or outcomes from your training session, please feel free to reach out - email in profile.
Yes, I was thinking of `matmul()`, sorry about that! The visualization is everything I hoped:
https://x.com/oranlooney/status/1977728062289555967
Awesome work. Surprised rand isn't implemented yet, I found it pretty useful for playing around.