[{"data":1,"prerenderedAt":21},["ShallowReactive",2],{"chapter:teenygrad\u002Fpytorch-interop\u002Fteeny-torch.json":3},{"project":4,"route":5,"title":6,"titleHtml":7,"navTitle":6,"part":8,"sourcePath":9,"editUrl":10,"html":11,"toc":12,"hasMermaid":13,"prev":14,"next":17},"teenygrad","\u002Fteenygrad\u002Fpytorch-interop\u002Fteeny-torch","Using teeny-torch","Using \u003Ccode>teeny-torch\u003C\u002Fcode>","PyTorch Interop","pytorch-interop\u002Fteeny-torch.md","https:\u002F\u002Fgithub.com\u002Fteenygrad\u002Fteenygrad\u002Fedit\u002Fmain\u002Fbooks\u002Fteenygrad\u002Fsrc\u002Fpytorch-interop\u002Fteeny-torch.md","\u003Cp>\u003Ccode>teeny-torch\u003C\u002Fcode> is a \u003Ca href=\"https:\u002F\u002Fpyo3.rs\" target=\"_blank\" rel=\"noopener noreferrer\">PyO3\u003C\u002Fa>-based Python extension module (built as a \u003Ccode>cdylib\u003C\u002Fcode>,\nPython module name \u003Ccode>teenygrad\u003C\u002Fcode>) bridging teenygrad into PyTorch-style Python workflows.\u003C\u002Fp>\n\u003Cblockquote>\n\u003Cp>\u003Cstrong>Not published to crates.io.\u003C\u002Fstrong> \u003Ccode>teeny-torch\u003C\u002Fcode> (and \u003Ccode>teeny-fxgraph\u003C\u002Fcode>, which it depends on) are\nexcluded from the crates.io publish set (\u003Ccode>publish = false\u003C\u002Fcode>) — they’re the PyTorch compatibility\nlayer, not part of the public Rust SDK. \u003Ccode>teeny-torch\u003C\u002Fcode> is distributed as a Python package (PyPI),\nnot a Rust crate.\u003C\u002Fp>\n\u003C\u002Fblockquote>\n\u003Cp>It depends on \u003Ccode>teeny-core\u003C\u002Fcode>, \u003Ccode>teeny-fxgraph\u003C\u002Fcode>, and \u003Ccode>teeny-compiler\u003C\u002Fcode>, and uses \u003Ccode>egg\u003C\u002Fcode> (see\n\u003Ca href=\"\u002Fteenygrad\u002Fcompiler-internals\u002Foptimizer\">The egg\u002Fz3 Optimizer\u003C\u002Fa>) and \u003Ccode>flatbuffers\u003C\u002Fcode> for its own\nserialization needs (built via \u003Ccode>flatc-rust\u003C\u002Fcode> in \u003Ccode>build.rs\u003C\u002Fcode>).\u003C\u002Fp>\n\u003Cblockquote>\n\u003Cp>\u003Cstrong>TODO\u003C\u002Fstrong>: document the actual Python-facing API and installation instructions once this crate\nhas a stable public interface and a packaging story for PyPI.\u003C\u002Fp>\n\u003C\u002Fblockquote>\n",[],false,{"title":15,"titleHtml":15,"route":16},"The LLVM\u002FMLIR Backend","\u002Fteenygrad\u002Fcompiler-internals\u002Fllvm-backend",{"title":18,"titleHtml":19,"route":20},"teeny-cli and Ahead-of-Time Compilation","\u003Ccode>teeny-cli\u003C\u002Fcode> and Ahead-of-Time Compilation","\u002Fteenygrad\u002Fcli-and-aot\u002Fteeny-cli",1786271829006]