mridul-afk/Minipypy ? reverse-engineered prompt
Reverse engineered prompt
Build me a small PyTorch like tensor library in C++ with CUDA support and Python bindings, so I can create tensors, do math on the GPU, and train simple neural nets from Python.
I want it to support things like broadcasting, matrix multiplication, reverse mode autograd, ReLU, softmax, and common losses like MSE, cross entropy, and BCE with logits. It should also have a simple nn module system with Linear, Sequential, and optimizers like SGD and Adam, so I can write a normal training loop and backprop works.
Please include a few runnable examples, like a tiny MNIST style training script and a simple benchmark comparing a regular dense MLP with a low rank TensorFoldLinear version. If you need to check current build or CUDA setup details, look up the latest docs online.