you can use `numpy.reshape(ndarray, shape)` and `arraymancer.reshape(tensor, 
shape)`. The module name can serve as namespacing prefix when calling functions.

Also your object types PyObject vs Tensor should disambiguate what to call for 
the compiler so I would be surprised if there was conflict, do you have an 
example to reproduce?

I personally didn't look into Numpy interop yet. My plan was to introduce 
zero-copy interop with Numpy once this PR lands 
[https://github.com/mratsim/Arraymancer/pull/420](https://github.com/mratsim/Arraymancer/pull/420)
 but it's being blocked by a Nim bug: 
[https://github.com/nim-lang/Nim/issues/13193](https://github.com/nim-lang/Nim/issues/13193)

That said, Arraymancer supports both read and write from .npy files, see tests: 
[https://github.com/mratsim/Arraymancer/blob/28a0a255/tests/io/test_numpy.nim](https://github.com/mratsim/Arraymancer/blob/28a0a255/tests/io/test_numpy.nim).
 The only limitation is that you need to pass the data type.
    
    
    let a = read_npy[int64](filePathIn)
    a.write_npy(filePathOut)
    
    
    Run

Reply via email to