Can I port my Python lib to Mojo?
I am developing a torch-based AI lib. I want to make it faster (specially the non-torch parts). Can I do a full port to Mojo amd expect it to work on Python AND Mojo?
5 Replies
Congrats @Vicente, you just advanced to level 1!
If u perform operations in pure python that slow down ur code then I think yes rewriting those parts in mojo may make ur code run faster. But calling torch functions from mojo repeatedly may have a worse performance than calling them directly from python. U should do some tests
In one my projects I use sklearn to generate test data then perform ml operations on those data. U can check it here:
https://github.com/yetalit/Mojmelo/tree/main/tests
GitHub
Mojmelo/tests at main · yetalit/Mojmelo
Machine Learning algorithms in pure Mojo 🔥. Contribute to yetalit/Mojmelo development by creating an account on GitHub.
Take a look at a [algorithm]_test.mojo file then u'll understand how I call python functions
Thanks, I will check 😄