PyTorch Internals: Ezyang's Blog
blog.ezyang.com
blog.ezyang.com
It is a modern and clean codebase without legacies, and I could understand most things without seeking external articles.
I'm asking because it seems to have nice autodiff functionality. It even supports differentiating array mutation (https://ml-explore.github.io/mlx/build/html/usage/indexing.h...), which is something JAX and Zygote.jl can't do. Instead, both have ugly tricks like `array.at[index].set` and the `Buffer` struct.
So it would be cool to have this functionality on a "regular" CPU.
TORCH_CHECK(self.dim() == 1)
<< "Expected dim to be a 1-D tensor "
<< "but was " << self.dim() << "-D tensor";
Turns out it's possible to write TORCH_CHECK() so that it evaluates the streaming operators only if the check fails. (Check out how glog works.)[1]: https://dev-discuss.pytorch.org/t/meta-pytorch-team-2025-h1-...
[2]: https://dev-discuss.pytorch.org/t/pytorch-symmetricmemory-ha...
[3]: https://dev-discuss.pytorch.org/t/where-do-the-2000-pytorch-...
[4]: https://dev-discuss.pytorch.org/t/rethinking-pytorch-fully-s...