MyTorch is a lightweight automatic differentiation framework that mimics the PyTorch API.
MyTorch Released: An Automatic Differentiation Library in 450 Lines of Python Supporting Higher-Order Derivatives via PyTorch-Compatible API
This article is a translation. Read the Japanese original
It utilizes NumPy for computational processing and implements graph-based reverse-mode automatic differentiation.
The library is designed for easy extensibility, and it is reported that the addition of torch.nn and support for GPU execution are being considered.
Of particular note is its ability to calculate arbitrary higher-order derivatives for both scalar and non-scalar variables.
While PyTorch requires create_graph=True for higher-order derivatives, MyTorch can perform these calculations without additional configuration.
It also supports standard APIs such as torch.autograd.backward and torch.autograd.grad.
Sources: MyTorch – Minimalist autograd in 450 lines of Python (HN 100pt, 19 comments) (HN Search (backfill), 2026-01-04)