SciNim / flambeau

Nim bindings to libtorch
85 stars 3 forks source link

Wrapping #1

Closed mratsim closed 3 years ago

mratsim commented 4 years ago

Yeah, first commit, first issue.

2 practical ways forward for generating the wrapper:

But it seems like nimterop -recurse does see the include but does not go deep? cc @genotrance

image

After running torch_installer

toast -f:ast2 -n -m=cpp -k -I={/path/to/minitorch/libtorch/include/} -r minitorch/libtorch/include/ATen/ATen.h 
genotrance commented 4 years ago

Toast still doesn't know C++, though I'm getting closer to start working on adding support.

You could use c2nImport() with recurse and see if c2nim can process the code. If there's no templates, it should be doable.

Or just run toast on the cli with the -pr flag but without -n which will generate the preprocessed recursed header which can then be run thru c2nim.

mratsim commented 3 years ago

Closing. The bindings will be done manually.

This also will ensure high-quality and ergonomics and exploit all the implicit conversions/overloads in particular for c10::optional` andTensorOptions`` parameters.