M
Modular14mo ago
Sagi

PyObject support

Currently in my tests, it is very slow to transfer big numpy arrays, like from a camera into a mojo Tensor, will this case have better support in the future?
3 Replies
ksandvik
ksandvik14mo ago
I assume this is via CPython, yes if there will be ways to convert the structures directly in compiled mojo code.
Sagi
SagiOP14mo ago
I mean that why you do like let np = Python.import_module("numpy") let x = np.array([1, 2, 3]) Than x is PyObject, and if you want to iterate x fastly you would rather x to be Tensor, I am asking if there will be an intended way that will work fast to transfer PyObject, eve only numpy arrays into moji's Tensor
ksandvik
ksandvik14mo ago
I'm sure something like this will happen in future, might be that parts of NumPy might support mojo directly.
Want results from more Discord servers?
Add your server