4 ms·
> Well easier than bundling pytorch on an embedded device. I don't follow - wouldn't nimtorch also require bundling pytorch on an embedded device?
by MiroF 6y ago
> Well easier than bundling pytorch on an embedded device.
I don't follow - wouldn't nimtorch also require bundling pytorch on an embedded device?
- elcritch 6y agoYes and no, Pytorch (like Tensorflow for Python) is just a wrapper around a core C++ library. So you can compile a binary from C++ linking to the pytorch libs without including Python. Technically it's pytorch, but without Python and Python dependency management which is way simpler. Nimtorch let's you wrap the C++ api of pytorch with nice Pythonic looking code, a GC, but using only C++ and possibly statically linked. Win win. See: https://pytorch.org/tutorials/advanced/cpp_frontend.html https://pytorch.org/tutorials/advanced/cpp_frontend.html
- MiroF 6y agoYes I understand pytorch quite well - I was merely confused because I consider the C++ library to still be pytorch. I don't see the advantage of this setup over just loading a torchscript model in C++ or any other static language. A full set of bindings seems unnecessary unless you need to train in nim.
- elcritch 6y agoTrue, my terminology was a bit outdated as I keep thinking of pytorch as just the Python wrapper on libtorch. That's not really true. I prefer to avoid Python nowadays due to the pain of dependency management, a nice as this article is don't care to learn about Poetry. So training in pure C++ (or better Nim) is my preferred setup. Keeping a similar build setup for both training and deployment saves a lot of headaches which is why the nimtorch interface is handy even if it's not as full featured/up to date. Now I'm only deploying a very simple NN without much need for experimentation.