5 ms·
Okay. Humor me. I want to write a transformer-based classifier for a project. I am accustomed to the pytorch and tensorflow libraries. What is the equivalent us
by airza 1y ago
Okay. Humor me.
I want to write a transformer-based classifier for a project. I am accustomed to the pytorch and tensorflow libraries. What is the equivalent using C?
- adastra22 1y agoYou do know that tensorflow was written in C++ and the Python API bolted on top?
- wolvesechoes 1y agoIt could be written in mix of Cobol and APL. No one cares. People saying "oh those Python libraries are just C/C++ libraries with Python API, every language can have them" have one problem - no other language has them (with such extensive documentation, tutorials etc.)
- adastra22 1y agoTensorflow has extensive documentation of its C++ interface, as that is the primary interface for the library (the Python API is a wrapper on top).
- wolvesechoes 1y agoI hoped it was quite obvious that by "other languages" I meant "other than Python and C/C++ in which they are written". At least sibling actually mentioned Java.
- adastra22 1y agoScroll up this thread and the other poster was asking if you can use pytorch and tensorflow from C. Both are C++ libraries, so accessing them from C/C++ is pretty trivial and has first-class support.
- wolvesechoes 1y agoYou should read more carefully before responding. I said "beside Python, and C/C++ in which they are written" You: "you can see people are using it from C". What a surprise that library usable from Python through wrapped C API has C API!
- pjmlp 1y agoPyTorch and Tensorflow also support C++ (naturally) and Java.
- airza 1y agoI am. Are you suggesting that as an alternative to the python bindings i should use C to invoke the C++ ABI for tensorflow?
- adastra22 1y ago> Okay. Humor me. I want to write a transformer-based classifier for a project. I am accustomed to the pytorch and tensorflow libraries. What is the equivalent using C? Use C++ bindings in libtorch or tensorflow. If you actually mean C, and not C++, then you would need a shim wrapper. C++ -> C is pretty easy to do.